Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>try this:</p> <pre><code>add.php ... while ( $db_field = mysql_fetch_assoc($result) ) { $sponsored = $db_field['Name']; } header('Location: add.php?pupil='.$_POST['pupilno'].'&amp;name='.$sponsored ); ... </code></pre> <p>and then</p> <pre><code>details.php ... &lt;form action="paypal.php" method="post"&gt; Pupil No: &lt;input type="text" name="pupilid" value="&lt;?php $_GET['pupil'] ?&gt;"&gt;&lt;p/&gt; pupil Name: &lt;input type="text" name="sponsored" value="&lt;?php $_GET['name'] ?&gt;"&gt;&lt;p/&gt; Your Name: &lt;input type="text" name="name"&gt;&lt;p/&gt; Your Email :&lt;input type="text" name="email"&gt;&lt;p/&gt; Phone No: &lt;input type="text" name="phone"&gt;&lt;p/r&gt; Country: &lt;input type="text" name="country"&gt;&lt;p/&gt; Contribution:&lt;input type="text" name="con"&gt;&lt;p/&gt; &lt;input type="submit" value="Send it!"&gt; &lt;/form&gt; ... </code></pre> <p>HOWEVER, there is much more that should be done to validate the POST/GET variables and to protect yourself from SQL injection on you add.php page - I would combine the add.php and details.php scripts but that is based on the simplistic view of your example and there may be other reasons for having them seperated.</p> <p>the php mysql function has also been deprecated (<a href="http://www.php.net/mysql_query" rel="nofollow noreferrer">http://www.php.net/mysql_query</a>) look into updating your scripts now to mysqli_query or PDO and read up on SQL injection prevention: <a href="https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php">How can I prevent SQL injection in PHP?</a> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload