richrock Posted November 25, 2008 Share Posted November 25, 2008 Hi, I'm using Wamp 2.0, and I've got a problem with a stuck page. I have various buttons that link to an instruments.php page, and I've done something that causes this error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Documents\wamp\www\auctionsys\administration\instruments.php on line 636 even if I clear the cache, restart WAMP, empty the php file to an emtpy document, the error still appears.... Help!!! I've read up on the error, I understand what the error means, but even removing the block of code around the 636 mark does not change the line number in the error or even remove the error itself... Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/ Share on other sites More sharing options...
DimitriDV Posted November 25, 2008 Share Posted November 25, 2008 show us the whole code, the error line is not always the line where the error is located Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698480 Share on other sites More sharing options...
richrock Posted November 25, 2008 Author Share Posted November 25, 2008 There's 920 lines of code, are you sure???? Ah, I'll attach the file Please don't mock the code, it's a bit of a mess too. It's part of an admin panel for administering, and will be password protected later on. Modified - 920 lines not 9202 as mentioned earlier [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698483 Share on other sites More sharing options...
waynew Posted November 25, 2008 Share Posted November 25, 2008 Delivery for OP: <?php //require('makeSecure.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="form.css" rel="stylesheet" type="text/css" /> <title>instruments.php</title> </head> <body> <?php require('lang.php'); ?> <?php require('connect.php'); ?> <?php require('functions.php'); ?> <?php include('index.php'); ?> <div id="main-page"> <?php if ($_POST['newCliInst']) { addUser(); // Insert new user into the DB //getnewCliInst(); // Retrieve Client ID number for form validation } if (($_POST['addlot']) || (($_POST['addInstr']) && ($_POST['MAX_FILE_SIZE'] > 0 ))) { newLine(); //printNewReceipt(); } if ($_POST['recnum'] > 0) { echo $_POST['recnum']; $mainrecnum = $_POST['recnum']; echo $mainrecnum; } // Auction Details $page_source=$_POST['addlots']; $item_num=$_POST['item_num']; $title=$_POST['title']; $salenum=$_POST['salenum']; $shortdesc=$_POST['shortdesc']; $detaileddesc=$_POST['detaileddesc']; $estlow=$_POST['estlow']; $esthigh=$_POST['esthigh']; $pricestart=$_POST['pricestart']; $reserve=$_POST['reserve']; $condition=$_POST['condition']; $vat=$_POST['vat']; $outsideeu=$_POST['eu']; $warranty=$_POST['warranty']; // User Details $userid=$_POST['name']; $usrid = $_POST['userid']; $userid = $_POST['name']; // USER ID SELECTION // Database Queries $queryid = "SELECT * FROM jos_users ORDER BY id"; $resultid = mysql_query($queryid) or die('User ID query failed: ' .mysql_error()); // Generate User Lists $row_selectid = mysql_fetch_assoc($resultid); $totalRows_selectid = mysql_num_rows($resultid); // NAME SELECTION // Database Queries $queryuser = "SELECT * FROM jos_users ORDER BY name"; $resultuser = mysql_query($queryuser) or die('User query failed: ' . mysql_error()); // Generate User Lists $row_selectuser = mysql_fetch_assoc($resultuser); $totalRows_selectuser = mysql_num_rows($resultuser); // USERNAME SELECTION // get the database query - auctions $queryuname = "SELECT * FROM jos_users ORDER BY username"; $resultuname = mysql_query($queryuname) or die('Client query failed: ' . mysql_error()); // generate selected name rows $row_selectuname = mysql_fetch_assoc($resultuname); $totalRows_selectuname = mysql_num_rows($resultuname); // SALE NUMBER SELECTION // get database query - sale numbers $querysalenum = "SELECT * FROM jos_bid_categories ORDER BY id"; $resultsalenum = mysql_query($querysalenum) or die('Sale number selection failed: ' . mysql_error()); // generate the rows $row_selectsalenum = mysql_fetch_assoc($resultsalenum); $totalRows_selectsalenum = mysql_num_rows($resultsalenum); // Get the receipt details // if Adding Instrument, after selecting a user. if ((($_POST['addInstr']) && ($_POST['name'] > 0 )) || ($_POST['addlot']) && ($_POST['name'] > 0)) { $userid = $_POST['name']; $qreceipt = "SELECT DISTINCT receipt_num FROM jos_bid_receipts WHERE user_id = '$userid'"; $rreceipt = mysql_query($qreceipt) or die('Receipt selection failed: ' . mysql_error()); $row_selectrecn = mysql_fetch_assoc($rreceipt); $totalRows_selectrecn = mysql_num_rows($rreceipt); } // If Adding Instrument, new Line if ($_POST['salenum']) { $salenum = $_POST['salenum']; $gMaxLN = "SELECT MAX(line_num) as line_num FROM jos_bid_receipts WHERE receipt_num = '$salenum'"; //echo $gMaxLN; $rMaxLN = mysql_query($gMaxLN) or die('Line Number failure: ' . mysql_error()); $rowMaxLN = mysql_fetch_array($rMaxLN); $nMaxLN = $rowMaxLN['line_num']; //echo "<pre>Line Num: ".$nMaxLN."</pre>"; } // If editing an instrument if (($_POST['editInstr']) && ($_POST['meh'] > 0)) { $luid = $_POST['meh']; $getDetails = "SELECT * FROM jos_bid_receipts WHERE lot_id = '$luid'"; //echo $getDetails; $resDetails = mysql_query($getDetails) or die('Receipt Line Get failure: ' . mysql_error()); $redit_details = mysql_fetch_array($resDetails); $edit_recnum = $redit_details['receipt_num']; $edit_linenum = $redit_details['line_num']; //echo $edit_recnum.", ".$edit_linenum; } // Just a test of the emergency broadcast system if (!$_POST['rectest']) { //echo "No Receipt Tested"; } else { //echo "Receipt Validated"; } ?> <table> <tr> <td valign='top'> <?php // Remove this section if not needed if (($_POST['name']) || ($_POST['newCliInst'])) { } else { ?> <table width="600" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="4" class="thead-1"><?php if ($_POST['addInstr']) { echo "Select a Client to consign instruments."; } elseif ($_POST['editInstr']) { echo "Select a Client to edit consignments."; } else { echo LOT_edit_sellerdetails; } ?></td> </tr> <tr> <td valign="top"><?php echo LOT_edit_selectseller; ?></td> <td valign="top"><form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="name"> <input type="hidden" name="user_selected" value="user_selected" /> <?php if ($_POST['addInstr']) { echo "<input type='hidden' name='addInstr' value='addInstr' />"; } ?> <?php if ($_POST['editInstr']) { echo "<input type='hidden' name='editInstr' value='editInstr' />"; } ?> <select name="name" onchange='this.form.submit()'> <option>-- Client ID --</option> <?php do { echo "<option value='".$row_selectid['id']."'>".$row_selectid['id']."</option>"; } while ($row_selectid = mysql_fetch_assoc($resultid)); $rows = mysql_num_rows($resultid); if($rows > 0) { mysql_data_seek($resultid, 0); $row_selectid = mysql_fetch_assoc($resultid); } ?> </select> </form></td> <td valign="top"><form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="name"> <input type="hidden" name="user_selected" value="user_selected" /> <?php if ($_POST['addInstr']) { echo "<input type='hidden' name='addInstr' value='addInstr' />"; } ?> <?php if ($_POST['editInstr']) { echo "<input type='hidden' name='editInstr' value='editInstr' />"; } ?> <select name="name" onchange='this.form.submit()'> <option>-- Select a Name --</option> <?php do { echo "<option value='".$row_selectuser['id']."'>".$row_selectuser['name']."</option>"; } while ($row_selectuser = mysql_fetch_assoc($resultuser)); $rows = mysql_num_rows($resultuser); if($rows > 0) { mysql_data_seek($resultuser, 0); $row_selectuser = mysql_fetch_assoc($resultuser); } ?> </select> </td> <td valign="top"><form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="name"> <input type="hidden" name="user_selected" value="user_selected" /> <?php if ($_POST['addInstr']) { echo "<input type='hidden' name='addInstr' value='addInstr' />"; } ?> <?php if ($_POST['editInstr']) { echo "<input type='hidden' name='editInstr' value='editInstr' />"; } ?> <select name="name" onchange='this.form.submit()'> <option>--- Select By Username ---</option> <?php do { echo "<option value='".$row_selectuname['id']."'>".$row_selectuname['username']."</option>"; } while ($row_selectuname = mysql_fetch_assoc($resultuname)); $rows = mysql_num_rows($resultuname); if($rows > 0) { mysql_data_seek($resultuname, 0); $row_selectuname = mysql_fetch_assoc($resultuname); } ?> </select></form> </td> </tr> </table> <?php } ?> <table width="600" border="0" cellpadding="2" cellspacing="2"> <?php if (($_POST['name']) || ($userid) || ($_POST['newCliInst'])) { if ($_POST['newCliInst']) { $query_user = "SELECT MAX(id) as id, username, name, email FROM jos_users GROUP BY id ORDER BY id DESC LIMIT 1"; $result_user = mysql_query($query_user) or die('Profile mismatch error code 2: ' . mysql_error()); while ($r = mysql_fetch_array($result_user)) { $name=$r['name']; $username=$r['username']; $uid=$r['id']; $email=$r['email']; ?> <form action="clients.php" method="post" name="editClients"> <tr> <td colspan="2" class="thead-1">Seller Details</td> </tr> <tr> <td>User ID: </td> <td><?php echo $uid; ?></td> </tr> <tr> <td width="150">Name: </td> <td><?php echo $name; ?></td> </tr> <tr> <td>Username: </td> <td><?php echo $username; ?></td> </tr> <tr> <td>Email: </td> <td><?php echo $email; ?></td> </tr> <?php ?> <tr> <td>Edit These Details?</td> <td><input type="submit" name="editCliInst" value="Edit User Details" /></td> <input type="hidden" name="name" value="<?php echo $uid; ?>" /> </tr> <?php ?> </form> <?php } // } } else { // Results from select ID if (!$userid) $userid=$_POST['name']; //echo "UID: ".$userid; $query_user = "SELECT * FROM jos_users WHERE id = ".$userid.""; //echo "Q2: ".$query_user; $result_user = mysql_query($query_user) or die('Profile mismatch error code 3: ' . mysql_error()); } while ($r=mysql_fetch_array($result_user)) { $name=$r['name']; $username=$r['username']; $uid=$r['id']; $email=$r['email']; ?> <form action="clients.php" method="post" name="editClients"> <tr> <td colspan="2" class="thead-1">Seller Details</td> </tr> <tr> <td>User ID: </td> <td><?php echo $uid; ?></td> </tr> <tr> <td width="150">Name: </td> <td><?php echo $name; ?></td> </tr> <tr> <td>Username: </td> <td><?php echo $username; ?></td> </tr> <tr> <td>Email: </td> <td><?php echo $email; ?></td> </tr> <tr> <td>Edit These Details?</td> <td><input type="submit" name="editCliInst" value="Edit User Details" /></td> <input type="hidden" name="name" value="<?php echo $uid; ?>" /> </tr> </form> <?php } } ?> </table> <?php // Display the form AFTER selecting a name 2098 if (($_POST['name'] != NULL) || ($_POST['newCliInst']) || ($_POST['editCliInst'])) { ?> <table width="600" border="0" cellspacing="1" cellpadding="0"> <tr> <td colspan="2" class="thead-1"><?php echo LOT_lot_form; ?></td> </tr> <?php if ($_POST['name']) { $uid = $_POST['name']; //now select the lot to edit. $getLot = "SELECT * FROM jos_bid_auctions WHERE userid = ".$uid.""; $resLot = mysql_query($getLot) or die(mysql_error()); $querysalenum = "SELECT * FROM jos_bid_categories ORDER BY id"; $resultsalenum = mysql_query($querysalenum) or die(mysql_error()); // generate the rows $row_selectLot = mysql_fetch_assoc($resLot); $totalRows_selectLot = mysql_num_rows($resLot); $title = $row_selectLot['title']; if (($_POST['meh']) || ($_POST['editInstr'])) { ?> <tr> <td><?php echo LOT_salenum; ?> </td> <td> <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="meh"> <input type="hidden" name="name" value="<?php echo $userid; ?>" /> <input type="hidden" name="recnum" value="recnum_get" /> <?php if ($_POST['editInstr']) { echo "<input type='hidden' name='editInstr' value='editInstr' />"; } ?> <select name="meh" onchange="this.form.submit()"> <option value='none'>-- Select An Instrument To Edit --</option> <?php do { if ($salenum==$row_selectLot['id']) { echo "<option value ='".$row_selectLot['id']."' selected>".$row_selectLot['id'].", ".substr($row_selectLot["title"],0,50)."</option>"; } else { echo "<option value ='".$row_selectLot['id']."'>".$row_selectLot['id'].", ".substr($row_selectLot["title"],0,50)."</option>"; } } while ($row_selectLot = mysql_fetch_assoc($resLot)); $rows = mysql_num_rows($resLot); if($rows > 0) { mysql_data_seek($resultname, 0); $row_selectLot = mysql_fetch_assoc($resLot); } ?> </select> </form> </td> </tr> <?php // end the addlot phase } } if ($_POST['meh']) { $lotid = $_POST['meh']; $getLotInfo = "SELECT * FROM jos_bid_auctions WHERE id = ".$lotid.""; //echo "<pre>".$getLotInfo."</pre>"; $rGetLot = mysql_query($getLotInfo) or die(mysql_error()); while ($rLotInfo = mysql_fetch_array($rGetLot)) { $rtitle = $rLotInfo['title']; $rshort = $rLotInfo['shortdescription']; $rdetdesc = $rLotInfo['description']; $restlow= $rLotInfo['est_low']; $resthigh = $rLotInfo['est_high']; $rstprice = $rLotInfo['initial_price']; $rreserve = $rLotInfo['reserve_price']; $rcond = $rLotInfo['condition']; $rlinenum = $rLotInfo['line_num']; $rrecnum = $rLotInfo['rec_num']; $ritem_num = $rLotInfo['no_items']; $routsideeu = $rLotInfo['outside_eu']; $rage = $rLotInfo['age']; $rwarranty = $rLotInfo['warranty']; $rlot_num = $rLotInfo['lot_num']; $rtrate = $rLotInfo['commission']; $ruid = $rLotInfo['userid']; //echo "<pre>Line Num: ".$event."</pre>"; $getRecUID = "SELECT * FROM jos_bid_receipts WHERE lot_id = ".$lotid." AND user_id = ".$ruid.""; //$getRecUID = "SELECT * FROM jos_bid_receipts WHERE lot_num = ".$lotid." AND user_id = ".$ruid.""; //echo "<pre>".$getRecUID."</pre>"; $resRecUID = mysql_query($getRecUID) or die(mysql_error()); while ($rRowRECNUM = mysql_fetch_array($resRecUID)) { $recn = $rRowRECNUM['receipt_num']; $rlin = $rRowRECNUM['line_num']; //echo "<br />Receipt Number: ".$recn."..."; } } } ?> <?php // generate additional sale number if editing. if ($_GET[editlot]) { ?> <tr> <td><?php echo LOT_salenum; ?> </td> <td> <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="addlot" enctype="multipart/form-data"> <select name="salenum"> <option value='none'>-- Select A Sale --</option> <?php do { if ($salenum==$row_selectsalenum['id']) { echo "<option value ='".$row_selectsalenum['id']."' selected>".$row_selectsalenum['id']."</option>"; } else { echo "<option value ='".$row_selectsalenum['id']."'>".$row_selectsalenum['id']."</option>"; } } while ($row_selectsalenum = mysql_fetch_assoc($resultsalenum)); $rows = mysql_num_rows($resultsalenum); if($rows > 0) { mysql_data_seek($resultname, 0); $row_selectsalenum = mysql_fetch_assoc($resultsalenum); } ?> </select> </form> </td> </tr> <?php } ?> <form action="instruments.php" name="addlot" method="post" enctype="multipart/form-data"> <?php // Keep a check on the users details by having them at the top of the form. if($_POST['sourceadduser']) { $fname = $_POST['requiredfirstname']; $lname = $_POST['requiredsurname']; echo "<tr>\n"; echo "<td colspan='2'>\n"; echo LOT_add_client_name." "; echo $fname." ".$lname; echo "</td>\n"; echo "</tr>\n"; } ?> <!-- <tr> <td><span style="color:#FF0000"><?php echo LOT_recnum_conf; ?></span></td> <td><span style='color:#FF0000;'> <?php //echo $MaxRN; // if Adding New Item if (($_POST['addInstr']) && ($_POST['name'] > 0 ) && (!$_POST['salenum'])) { // Select the receipt to add the item to ?> <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="addlot" enctype="multipart/form-data"> <input type='hidden' name='addInstr' value='addInstr' /> <input type='hidden' name='name' value='<?php echo $_POST['name']; ?>' /> <select name="salenum" onchange='this.form.submit()'> <option value='none'>- Receipt -</option> <?php do { if ($rreceipt==$row_selectrecn['receipt_num']) { echo "<option value ='".$row_selectrecn['receipt_num']."' selected>".$row_selectrecn['receipt_num']."</option>"; } else { echo "<option value ='".$row_selectrecn['receipt_num']."'>".$row_selectrecn['receipt_num']."</option>"; } } while ($row_selectrecn = mysql_fetch_assoc($rreceipt)); $rows = mysql_num_rows($rreceipt); if($rows > 0) { mysql_data_seek($rreceipt, 0); $row_selectrecn = mysql_fetch_assoc($rreceipt); } ?> </select> </form> Please select a receipt number. <?php } if ($_POST['salenum']) { $sale_recn = $_POST['salenum']; echo $sale_recn; } /*if ($_POST['meh']) { echo "<span style='color:#FF0000;'>No Receipt or Client selected.</span>"; }*/ if ($_POST['meh'] > 0) { if ($edit_recnum == 0) { echo "No receipt number attached to this instrument."; } else { echo $edit_recnum; } } ?></span></td> </tr>--> <tr> <td valign="top"><?php echo LOT_linenum; ?> </td> <td valign="top"> <?php // Line number and receipt code // First of all the receipt number if (($_POST['addInstr']) || ($_POST['addlot']) && ($_POST['recnum'] == NULL)) { // Get the latest receipt number $getMaxRecNum = "SELECT MAX(receipt_num) as rnum FROM jos_bid_receipts"; echo "<pre>".$getMaxRecNum."</pre>"; $resMaxRecNum = mysql_query($getMaxRecNum) or die('Receipt Recovery failure at: ' . mysql_error()); $recNum = mysql_fetch_array($resMaxRecNum); $addingRecNum = $recNum['rnum']; $addRecNum = $addingRecNum + 1; echo "<input type='hidden' name='recnum' value='".$addRecNum."' />"; } if ($_POST['recnum'] > 0) { echo $mainrecnum; echo "<input type='hidden' name='recnum' value='".$mainrecnum."' />"; echo "<input type='hidden' name='sillyval3' value='from the if \$_POST recnum thingy' />"; } // Then the line numbers if (!$_POST['nextline']) { echo "<input type='hidden' name='nextline' value='not the first line' />"; } ?> <?php if (($_POST['newCliInst']) && (!$_POST['nextline'])) { generateRecNum(); } if(!$_POST['addlot']){ ?> <input type="text" name="linenum" value="1" size="10" readonly /> <?php } if ($_POST['linenum']) { $newnum = $_POST['linenum']; $nextnum = $newnum + 1; ?> <input type="text" name="linenum" value="<?php echo $nextnum; ?>" size="10" readonly /> <?php } ?> </td> </tr> <input type="hidden" name="item_num" value="1" /> <tr> <td valign="top"><?php echo LOT_title; ?> </td> <td valign="top"><input type='text' name='title' size='50' value='<?php if ($_POST['meh'] > 0) { echo $rtitle; } ?>' /></td> </tr> <tr> <td valign="top"><?php echo LOT_shortdesc; ?> </td> <td valign="top"><input type='text' name='shortdesc' size='50' value='<?php if ($_POST['meh'] > 0) { echo $rshort; } ?>' /></td> </tr> <tr> <td valign="top"><?php echo LOT_detailed; ?> </td> <td valign="top"><textarea name="detaileddesc" cols="47" rows="6"><?php if ($_POST['meh']) { echo $rdetdesc; } ?></textarea> </td> </tr> <tr> <td valign="top"><?php echo LOT_est_low; ?> </td> <td valign="top"><input name='estlow' type='text' size='50' value='<?php if ($_POST['meh']) { echo $restlow; } ?>' /></td> </tr> <tr> <td valign="top"><?php echo LOT_est_high; ?> </td> <td valign="top"><input name='esthigh' type='text' size='50' value='<?php if ($_POST['meh']) { echo $resthigh; } ?>' /></td> </tr> <tr> <td valign="top"><?php echo LOT_st_price; ?> </td> <td valign="top"><input name='pricestart' type='text' size='50' value='<?php if ($_POST['meh']) { echo $rstprice; } ?>' </td> </tr> <tr> <td><?php echo LOT_reserve; ?> </td> <td><input name='reserve' type='text' size='50' value='<?php if ($_POST['meh']) { echo $rreserve; } ?>' /></td></td> </tr> <tr> <td><?php echo LOT_condition; ?> </td> <td><input name='condition' type='text' size='50' value='<?php if ($_POST['meh']) { echo $rcond; } ?>' /></td> </tr> <tr> <td><?php echo LOT_photo_front; ?> </td> <td><input type="hidden" name="MAX_FILE_SIZE" value="8388608" /><input type="file" name="pictures[]" size="51" />(jpg format only)</td> <!--<td><input name='photofront' type='text' size='50' /><input type='button' value='Browse' /></td>--> </tr> <tr> <td><?php echo LOT_photo_rear; ?> </td> <td><input type="hidden" name="MAX_FILE_SIZE" value="8388608" /><input type="file" name="pictures[]" size="51" />(jpg format only)</td> </tr> <tr> <td><?php echo LOT_photo_detail; ?> </td> <td><input type="hidden" name="MAX_FILE_SIZE" value="8388608" /><input type="file" name="pictures[]" size="51" />(jpg format only)</td> </tr><!-- the image inputs were named pictures[] --> <!--<tr> <td colspan="2"><?php echo LOT_checkboxes; ?></td> </tr>--> <tr> <td><?php echo LOT_eu; ?> </td> <td><input type="checkbox" value="outside_eu" <?php if ($routsideeu == "Yes") { echo "checked"; } ?> /></td> </tr> <tr> <td><?php echo LOT_years; ?> </td> <td><input type="checkbox" value="over_100" <?php if ($rage == "Yes") { echo "checked"; } ?> /></td> </tr> <tr> <td><?php echo LOT_warranty; ?> </td> <td><input type="checkbox" value="warranty" <?php if ($rwarranty == "1") { echo "checked"; } ?> /></td> </tr> <tr> <td><?php echo LOT_comm_val; ?> </td> <td><select name="commission_rate"> <option value="">Select Rate</option> <option value="0" <?php if ($rtrate == 0){ echo "selected='selected'"; } ?> >0%</option> <option value="5" <?php if ($rtrate == 5){ echo "selected='selected'"; } ?> >5%</option> <option value="7" <?php if ($rtrate == 7){ echo "selected='selected'"; } ?> >7%</option> <option value="10" <?php if ($rtrate == 10){ echo "selected='selected'"; } ?> >10%</option> <option value="15" <?php if ($rtrate == 15){ echo "selected='selected'"; } ?> >15%</option> <option value="20" <?php if ($rtrate == 20){ echo "selected='selected'"; } ?> >20%</option> </select> <!--<tr> <td><?php echo LOT_print_rec; ?> </td> <td><input type="checkbox" value="print_rec" /></td> </tr>--> <tr> <td></td> <td> <?php if (($_POST['addInstr']) || ($_POST['addlot'])) { ?> <input type='hidden' name='recnum' value='<?php echo $addRecNum; ?>' /> <!--<input type="hidden" name="line_num" value="<?php echo $NMaxLN; ?>" />--> <input type="hidden" name="userid" value="<?php echo $usrid; ?>" /> <input type="hidden" name="user_id" value="<?php echo $uid; ?>" /> <input type="hidden" name="name" value="<?php echo $uid; ?>" /> <input type="hidden" name="norecnum" value="norecnum" /> <input type="hidden" name="sillyval1" value="from the base of the form" /> <?php } elseif ($_POST['meh']) { ?> <input type="hidden" name="userid" value="<?php echo $usrid; ?>" /> <input type="hidden" name="user_id" value="<?php echo $uid; ?>" /> <?php } if ($_POST['meh']) { $EL = 'editLot'; } if ($_POST['addInstr']) { $AL = 'addInstr'; } echo $editLot."<br />"; echo $addLot."<br />"; ?> <!-- <?php echo $EL; ?>--> <input type="submit" name="addlot" value="<?php echo LOT_add_another; ?>" /> <!-- <?php echo $AL; ?>--> <input type="submit" name="addlots" value="<?php echo LOT_save; ?>" /> <input type="hidden" value="<?php echo $uid; ?>" name="userid" /> </form></td> </tr> <tr> <td>Move to save & finish</td> <td> <table border="1"> <tr> <td> <?php if (($_POST['addInstr']) || ($_POST['addlot'])) { ?> <form action="receipt.php" method="post" name="generate_receipt"> <input type="hidden" name="rec_id" value="34" /> <input type="submit" name="gen_rec" value="gen_rec" /> <input type="hidden" name="recnum" value="<?php echo $MaxRN; ?>" /> </form> <?php } ?> </td> </tr> </table> <?php // Add the final receipt page // Generate as per layout. if ($_POST['gen_rec']) { echo "Value Selected."; } ?> </td> <tr> <td></td> <td><form action="admin.php" method="get" name='admin'><input type="submit" name='admin' value="<?php echo MCP_015; ?>" /></form></td> </tr> </table> </td> <td valign="top"> <?php } if($_POST['name']) { ?> <table width="300" border="0" cellspacing="2" cellpadding="2"> <tr> <td colspan="2" class="thead-1">Sale History </td> </tr> <tr> <td><strong>Item:</strong></td> <td><strong>Price:</strong></td> </tr> <?php // Return Results for items sold by this user //if($_POST['name']) { $usrid=$_POST['name']; $query_lots = "SELECT title, final_price FROM jos_bid_auctions WHERE userid = ".$usrid." ORDER BY id LIMIT 15"; $result_lots = mysql_query($query_lots) or die(mysql_error()); if (mysql_num_rows($result_lots) == 0) { //Return a zero results - this may be for new users, or no sellers echo "<tr><td valign='top' colspan='2'>"; echo "No Sale History Found"; echo "</td></tr>"; } while ($r=mysql_fetch_array($result_lots)) { $title=$r['title']; $price=$r['final_price']; $bid_id=$r['id']; echo "<tr><td valign='top'>"; echo "<a href='index.php?option=com_bids&task=viewbids&id=".$bid_id."&Itemid=159' target='_blank' class='auction-link'><strong>$title</a></strong>"; echo "</td><td valign='top'>"; echo "£"; echo number_format($price,2); echo "</td></tr>"; } ?> </td> </tr> <tr> <td colspan="2" class="thead-1">Bidding History </td> </tr> <tr> <td><strong>Item:</strong></td> <td><strong>Bid:</strong></td> </tr> <?php // Get results of unique bids made by this user if($_POST['name']) { //echo "<tr><td colspan='2'>"; //print_r($_POST); //echo "</td></tr>"; $usrid=$_POST['name']; $query = "SELECT DISTINCT * FROM jos_bid_auctions LEFT JOIN jos_bids ON jos_bids.userid WHERE jos_bids.userid = ".$usrid." LIMIT 15"; $result = mysql_query($query) or die(mysql_error()); $query2 = "SELECT DISTINCT * FROM jos_bids WHERE jos_bids.userid = ".$usrid.""; $result2 = mysql_query($query2) or die(mysql_error()); if (($result) > 0) { $bid_id = $result2['id']; echo $bid_id; } if (($result) == 0) { echo "<tr><td colspan='2'>"; echo "No Details Found"; echo "</td></tr>"; } while ($res=mysql_fetch_assoc($result)) { $offer=$res['id_offer']; $title=$res['title']; $bid_id=$res['id']; $bidding=$res['bid_price']; echo "<tr><td>"; echo $bid_id; echo $offer." - <a href='index.php?option=com_bids&task=viewbids&id=".$bid_id."&Itemid=159' target='_blank' class='auction-link'><strong>$title</a></strong>"; echo "</td><td>"; echo "£".number_format($bidding,2); echo "</td></tr>"; } } ?> </table> </td> </tr> </table> <?php } ?> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698486 Share on other sites More sharing options...
waynew Posted November 25, 2008 Share Posted November 25, 2008 You forgot to close off your quotes on line 636. Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698487 Share on other sites More sharing options...
richrock Posted November 25, 2008 Author Share Posted November 25, 2008 Okay, I'm still a bit new at this, and can't see the wood for the trees, so to speak. In my editor, line 636 is: if ($_POST['meh']) { and the block around that is: <tr> <td valign="top"><?php echo LOT_st_price; ?> </td> <td valign="top"><input name='pricestart' type='text' size='50' value='<?php if ($_POST['meh']) { echo $rstprice; } ?>' </td> </tr> (lines 633-640 inclusive) I see an error and have changed to enclose the <input> statement: <tr> <td valign="top"><?php echo LOT_st_price; ?> </td> <td valign="top"><input name='pricestart' type='text' size='50' value='<?php if ($_POST['meh']) { echo $rstprice; } ?>' /></td> </tr> Which to me now reads absolutely correct. The statements above and below are in the same format too. I still have the error at line 636, and also doesn't explain why when I have an empty php file called instruments.php the error still exists... (btw - I apologise if this sounds a bit shirty/cocky, it's not mean't to be - I'm really appreciative of your help here) Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698498 Share on other sites More sharing options...
waynew Posted November 25, 2008 Share Posted November 25, 2008 On 629: if ($_POST['recnum'] > 0) { echo $mainrecnum; echo "<input type='hidden' name='recnum' value='".$mainrecnum."' />"; echo "<input type='hidden' name='sillyval3' value='from the if \$_POST recnum thingy' /> } As you can see, you didn't close off the double quotes of your echo statement. if ($_POST['recnum'] > 0) { echo $mainrecnum; echo "<input type='hidden' name='recnum' value='".$mainrecnum."' />"; echo "<input type='hidden' name='sillyval3' value='from the if \$_POST recnum thingy' />"; } Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698500 Share on other sites More sharing options...
richrock Posted November 25, 2008 Author Share Posted November 25, 2008 Thanks man, well appreciated. For some bizarre reason, the editor had loaded up an older file from the sub-folder, so any edits weren't affecting the proper file. Silly me. Thanks again! BTW - I'd placed thos sillyvals to check what $_POST variables were being sent. This script has become quite confusing for me Link to comment https://forums.phpfreaks.com/topic/134181-solved-php-stuck/#findComment-698511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.