Re: re: Undefined Variable
| From: | Stut | Date: | Sun, 30 Apr 2006 12:20:52 +0000 |
| Subject: | Re: re: Undefined Variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235143@lists.php.net to get a copy of this message | ||
Smart Software wrote:
while(query )//here the query is opened {Actually a Javascript question, but I seem to be in a rare good mood today, so you're in luck. In the snippet below I've also fixed some syntax issues that tell me you really don't know what you're doing. On the other hand it could just be what you wrote in the email and not what you are actually trying to run. Either way I suggest you Google for a beginners tutorial on PHP to learn some basics. <?php $counter = 0; while(query) //here the query is opened [Stut: If you say so!] { ?><table "> <tr> <td ><?php query->name ?> </td> // record from database <td > Please fill in your age:</td> //text <td "><input name="age" type="text" </td> //textbox, <td ><a href="<? echo"otherform.php?age=PLACE_HERE_THE_VALUE_FROM_QUANTITY_TEXTBOX&name=query->name"; ?> "</td></tr> </table>}
<table>
<tr>
<td><?php $query->name ?></td> // record from database
<td>Please fill in your age:</td> //text
<td><input id="age<?=$counter?>" name="age" type="text"</td> //textbox,
<td><a href="#" onclick="location.href = 'otherform.php?age=' + document.getElementById('age<?=$counter?>').value + '&name=<?=urlencode($query->name)?>'; return false;">Save Age</a></td>
</tr>
</table>
<?php
$counter++;} ?> What this is doing is assigning an ID to each age textbox, that allows the onclick handler for the link (which you had not closed properly or given some text to display) to get the value and add it to the URL it links to. I suggest you run this and compare the source file and the output to see what is server-side and what is client-side, because I don't think you understand the difference yet. Enjoy. -Stut