Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $Vehicle = 1;
- if (($handle = fopen("DATA.csv", "r")) !== FALSE) {
- while (($Vehicle_Information = fgetcsv($handle, 1000, ",")) !== FALSE) {
- $num = count($Vehicle_Information);
- // establishing common variables based on input from CSV
- $stock = $Vehicle_Information[0];
- $year = $Vehicle_Information[1];
- $make = $Vehicle_Information[2];
- $model = $Vehicle_Information[3];
- $VIN = $Vehicle_Information[4];
- $miles = $Vehicle_Information[5];
- $color = $Vehicle_Information[6];
- $features = $Vehicle_Information[7];
- $VPrice = $Vehicle_Information[8];
- $WPrice = $Vehicle_Information[9];
- $IPrice = $Vehicle_Information[10];
- $DOL = $Vehicle_Information[11];
- $Location = $Vehicle_Information[12];
- $DealerCost = $Vehicle_Information[13];
- $engine = $Vehicle_Information[14];
- $trans = $Vehicle_Information[15];
- //Create an array containing Vehicle Information
- $test = array($stock, $year, $make, $model, $VIN, $miles, $color, $features, $VPrice, $WPrice, $IPrice, $DOL, $Location, $DealerCost, $engine, $trans);
- //Encode the array to prepare for travel to other pages
- $encode = rawurlencode(serialize($test));
- //Import the CSS
- echo '<link rel="stylesheet" type="text/css" href="style.css" />';
- // format for the table
- echo "<ul class=Vlist ><a href=page2Test.php?testvar=".$encode. "\">";
- echo "<li class=Vlist>$Vehicle_Information[0] - $Vehicle_Information[1] - $Vehicle_Information[2] $Vehicle_Information[3] - $Vehicle_Information[4]</li>";
- echo "</a>";
- echo "</ul>";
- $Vehicle++;
- for ($i=0; $i < $num; $i++) {
- $Vehicle_Information[$i] . "<br />\n";
- }
- }
- fclose($handle);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement