Re: re: Undefined Variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Smart Software wrote:
while(query )//here the query is opened
{
    <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>
}

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 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux