Skip to main content
Participant
April 24, 2006
Question

Need help with some PHP

  • April 24, 2006
  • 1 reply
  • 276 views
Hi

Im new to working with PHP so apologies if this sounds simple but im trying to pass variables through my site and it doesnt seem to be working.

Basically i have a form with a list and a submit button. The list is called 'choice' and the form links to a php page where the variable 'choice' should be displayed.

But when i choose my selection and then press submit my choice hasnt showed up.

The code i got which should display the choice is:

<?php echo $choice?>

im pretty sure this is right but its not working

any help much appreciated
This topic has been closed for replies.

1 reply

Inspiring
April 24, 2006
You need to tell PHP where the data is coming from.

If the form is sent using the POST method use:

<?php echo $_POST['choice']; ?>

If the form is sent using the GET method, or your pulling data from a URL
parameter use:

<?php echo $_GET['choice']; ?>

Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.


Participant
April 24, 2006
thanks for that - its working now

cheers