Skip to main content
Participant
Apr 24, 2006 3:20 PM UTC
Question

Need help with some PHP

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
Apr 24, 2006 3:29 PM UTC
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.


Translate
Participant
Apr 24, 2006 3:39 PM UTC
thanks for that - its working now

cheers
Translate