Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need help with some PHP

New Here ,
Apr 24, 2006 Apr 24, 2006
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
TOPICS
Server side applications
278
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 24, 2006 Apr 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.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2006 Apr 24, 2006
LATEST
thanks for that - its working now

cheers
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines