Page 1 of 1

[SOLVED] GET help

Posted: Mon Jun 28, 2004 10:39 pm
by C_Calav
hi guys, i got this loop going listing all these planes and im using GET on the URL,

Code: Select all

<?php
    
echo "<tr>
         <td> 
 <a href='order1.php?P_Stock=<?php echo $P_Stock;>'> $P_Stock </a>  
        </td>
     	   <td>$P_Name</td>
     	   <td> $P_Cat </td>
     	   <td> $P_Scale </td>
     	   <td> $P_Length </td>
     	   <td> $P_Span </td>
     	   <td> $P_Price </td>
     	   <td> $P_Desc </td> </tr> ";
?>
on the next page i have to test if it works. and it doesnt, am i doing something wrong here?

thanx for your help it is much appriacted, first tiome round for this!

oh, and is there a better way of doing this?


Code: Select all

<?php

    $P_Stock = $_GET['P_Stock'];

    echo" stock is $P_Stock ";
 
?>

Posted: Mon Jun 28, 2004 10:59 pm
by markl999
try:

Code: Select all

echo "<tr>
         <td>
<a href='order1.php?P_Stock=$P_Stock'> $P_Stock </a> 
        </td>
           <td>$P_Name</td>
           <td> $P_Cat </td>
           <td> $P_Scale </td>
           <td> $P_Length </td>
           <td> $P_Span </td>
           <td> $P_Price </td>
           <td> $P_Desc </td> </tr> ";

Make sure the url is correct, ie that it looks something like order1.php?P_Stock=5 or whatever, if it looks like order1.php?P_Stock= then $P_Stock isn't defined and your problem is before that echo.

Posted: Mon Jun 28, 2004 11:05 pm
by C_Calav
thanx very much you were right!