Jump to content

[SOLVED] Relaying information through a hidden input and a crazy error. Any ideas?


Obsession

Recommended Posts

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.8) 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?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.