joebgiddings Posted November 20, 2006 Share Posted November 20, 2006 Hello,First time i'm using PHP for a project at uni, we have been given some examples to work from, however i keep getting an error and i can't see what the problem is?this is the errorParse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\ebassignment\purchases1.php on line 24and this is the code its refering to:<html> <head> <title>Buyer </title> </head> <body> <h2> You chose</h2> <table> <?php $myFile = "(path)purchases.dat"; $fh = fopen($myFile, 'a') or die("can't open file\n"); $total=0; if (!($lines = file('items.txt'))) {echo 'ERROR: Unable to open file! </body></html>'; exit;} // assumes POST as method - see note below foreach ($_POST as $varname => $varvalue) { foreach($lines as $theline) {list($ISBN, $title, $author, $price_inc_vat, $price_ex_vat, $image, $qty) = split('\|', $theline); if ($ISBN==$varname) { //print out the line to browser echo " <tr> <td><img src='$image' ></td> <td> $author </td> <td> $price_inc_vat GBP </td> </tr>"; $total=$total+$price_inc_vat; //create an entry for append-write to file $content = $cust_num .'|'. $ISBN '\n'; if (!(fwrite($fh , $content))) { echo "Cannot write to ($myFile)\n</p>"; exit; } } } } // ending the 'foreach' loops echo " <tr> <td> </td> --------------this being line 24 $content = $cust_num .'|'. $ISBN '\n';Any help would be greatJoe Link to comment https://forums.phpfreaks.com/topic/27871-help-cant-find-the-error/ Share on other sites More sharing options...
trq Posted November 20, 2006 Share Posted November 20, 2006 [code=php:0]$content = $cust_num .'|'. $ISBN .'\n';[/code] Link to comment https://forums.phpfreaks.com/topic/27871-help-cant-find-the-error/#findComment-127455 Share on other sites More sharing options...
joebgiddings Posted November 20, 2006 Author Share Posted November 20, 2006 Is that all it was,Thank you thank you!Joe Link to comment https://forums.phpfreaks.com/topic/27871-help-cant-find-the-error/#findComment-127457 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.