Obsession Posted April 8, 2009 Share Posted April 8, 2009 Two quick questions. First up, will PHP still pull the correct information from this code- while($row = mysql_fetch_array($SearchRes)) { echo "<tr>"; echo "<td>" . $row['ItemType'] . "</td>"; echo "<td>" . $row['ItemPrice'] . "</td>"; echo "<td>" . $row['ItemDetails'] . "</td>"; echo "<td>" . $row['SupplierName'] . "</td>"; $FVPSupp=$row['SupplierName']; echo "<td>"; echo "<form action='ViewSupplier.php' method='POST'>"; echo "<input type='hidden' value='$FVPSupp' name='FVPSupp'>"; echo "<input type='submit' value='View Supplier'>"; echo "</form>"; echo "</td>"; echo "</tr>"; } Now, ignoring most of it, the form hidden in that code is the bit i'm interested in. Basically, the variable $FVPSupp needs to be used in the next page, so will that method of putting it through suffice or not? I thought a button like so- echo "<input type='button' value='View Supplier' onClick='location.href=ViewSupplier.php?name=$FVPSupp'>"; Only that wouldn't work, so I tried this hidden form method. Not sure if its working yet or not due to the next error. I'll need to include the entire page in this topic, sorry for the long thread. <html> <head> <link rel="stylesheet" href="Layout.css" type="text/css"> <link rel="stylesheet" href="View.css" type="text/css"> </head> <body> <div id="Border"> </div> <div id="Header"> <div id="Title"> <div class="TitleText">MiMar Construction Data</div> </div> </div> <div id="LeftSide"> </div> <div id="NavBar"> <br> <input type="button" value="Index" onClick="window.location='Index.html'"><br><br> <input type="button" value="Stats" onClick="window.location='Stats.php'"><br><br> <input type="button" value="Input" onClick="window.location='Input.php'"> </div> <div id="MainContent"><br><br> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Didn\'t connect, what a bitch!'); } mysql_select_db("Construction", $con); $SupplierName=$_POST['FVPSupp']; echo "<div id='SupplierName'>"; echo $SupplierName; echo "</div>"; $query=mysql_query("SELECT Delivery,Reliability FROM suppliers WHERE SupplierName='$SupplierName'"); while ($row = mysql_fetch_array($query)) { echo "<div id='Delivery'>"; echo $row['Delivery']; echo "</div>"; echo "<div id='Reliability'>"; echo $row['Reliability']; echo "</div>"; ?> </div> </body> </html> Now the error my browser(Firefox 3.0. returns is - Parse error: parse error in C:\wamp\www\Construction\ViewSupplier.php on line 54 Line 58 happens to be... </html> which has me baffled to hell and back. Is it trying to tell me the whole page is wrong or something? Maybe i'm not allowed HTML or something? Never seen it before at all, and havn't had much luck googling around. Anyone have any clues? Quote Link to comment https://forums.phpfreaks.com/topic/153230-solved-relaying-information-through-a-hidden-input-and-a-crazy-error-any-ideas/ Share on other sites More sharing options...
Obsession Posted April 8, 2009 Author Share Posted April 8, 2009 Meant line 54 is </html> , not line 58. Quote Link to comment https://forums.phpfreaks.com/topic/153230-solved-relaying-information-through-a-hidden-input-and-a-crazy-error-any-ideas/#findComment-804958 Share on other sites More sharing options...
Maq Posted April 8, 2009 Share Posted April 8, 2009 Your code is fine, you're just missing a '}'. echo ""; } // HERE ?> Quote Link to comment https://forums.phpfreaks.com/topic/153230-solved-relaying-information-through-a-hidden-input-and-a-crazy-error-any-ideas/#findComment-804959 Share on other sites More sharing options...
Obsession Posted April 8, 2009 Author Share Posted April 8, 2009 Damn, people like you should be paid for doing this, I combed through that code for about 25 minutes and didn't spot that. Quote Link to comment https://forums.phpfreaks.com/topic/153230-solved-relaying-information-through-a-hidden-input-and-a-crazy-error-any-ideas/#findComment-804960 Share on other sites More sharing options...
xtopolis Posted April 9, 2009 Share Posted April 9, 2009 Feel free to go crazy: http://www.phpfreaks.com/page/donations Quote Link to comment https://forums.phpfreaks.com/topic/153230-solved-relaying-information-through-a-hidden-input-and-a-crazy-error-any-ideas/#findComment-805139 Share on other sites More sharing options...
Maq Posted April 9, 2009 Share Posted April 9, 2009 Feel free to go crazy: http://www.phpfreaks.com/page/donations Yes, by all means, please do. All the cool kids are doing it... Quote Link to comment https://forums.phpfreaks.com/topic/153230-solved-relaying-information-through-a-hidden-input-and-a-crazy-error-any-ideas/#findComment-805141 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.