|
Posted by Steve on 11/08/06 04:06
| ok I have copied an pasted the code to three files, if you could point
| me into implimenting the this code to get an idea. then I will move on
| to the data base idea.
<?
require_once "vin.class.php"
// WVWPD63B72P342249 pretend this is the vin posted from a
// form or query string
$vin = $_REQUEST['vin'];
$vin = new vin($vin);
echo "<pre>\r\n" . print_r($vin->toXml(), true) . '</pre>';
echo "<pre>\r\n" . print_r($vin, true) . '</pre>';
?>
this simply prints the xml to the brower and then prints the vin object's
raw data. vin.class.php determines what manufacturer specific vin class to
instanciate. once instanciated, it simply allows that class to parse the vin
and translate the vin.
| look at www.classiccarmall.net I wrote most of the site and I have made
| alot of PHP changes as well
|
| I did not see any areas to have a person enter data
|
| I can continue to add case statments to increases it scope of vehicular
| data then impliment to a data base later.
only problem with this approach is that it is specific to A vehicle and not
a pattern that applies to ALL vehicles of the same type. so having one
person report their car info and supply its vin does nothing to help you
determine what pieces of the vin describe another car of the same
make/model/etc.
|
| I just need a simple example of how you impliment this in to the page
| source and call it externaly.
if you name the above code "vin.parse.php" and called it via:
http://localhost/vin.parse.php?vin=WVWPD63B72P342249
then you'd get output in the browser. depends on what you want to do though
as far as output goes. you can also include vin.parse.php into another
script, but you really don't need to as all you really need in that case is
to include the vin.class.php script and create a new vin($vin);
hth,
me
Navigation:
[Reply to this message]
|