View previous topic :: View next topic |
Author |
Message |
jwoodbr -
Joined: 09 Oct 2005 Posts: 4 Location: melbourne vic australia
|
Posted: Tue Oct 11, 2005 10:04 am Post subject: retrieving variables |
|
|
hey guys,
when posting a htm form the php page is loading however none of the variables are being read in. i have tried both post and get methods, however no change. any ideas?
html code
Code: |
<form action="submit.php" method = post >
<label> ctn </label><input type="text" name="Ctn" >
<input type="submit" name="Submit" value="Submit">
</form>
|
php code
Code: |
<p>
Thankyou for submitting your number.
<br> the number you have enetered is: <?php print $Ctn; ?>
</p>
|
thanks in advance
oops, i have tried it with print("$ctn") and print($ctn) but this also has no effect |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Tue Oct 11, 2005 11:24 am Post subject: |
|
|
Try changing to <?php echo $_GET['Ctn'] ?>, or <?php echo $_POST['Ctn'] ?> is you want to use POST. |
|
Back to top |
|
 |
jwoodbr -
Joined: 09 Oct 2005 Posts: 4 Location: melbourne vic australia
|
Posted: Tue Oct 11, 2005 11:34 am Post subject: |
|
|
worked a charm cheers! any explanation why this would work over the print method?? im new to web langauges. i should probably be heading over to a php forum to....... |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
|
Back to top |
|
 |
|