...

View Full Version : $_GET["name"]



Ndogg
01-24-2010, 12:33 AM
in a simple $_get from a form, how would I do something like this that works:

$_GET["Question0+($txt)"]

The name of the form field(s) is Question0# and there will be alot so im using variables that increase inbetween each question so that I dont have to change it myself.

JAY6390
01-24-2010, 01:08 AM
You would be better off naming your variables in your html as arrays so that you can use
$_GET['Question'][0] etc

You could use
$_GET['Question'.$i.'#'];
i suppose. It all depends on the context of your use

Ndogg
01-24-2010, 01:25 AM
Or I could acually just do this

$_GET['Question0'.$txt]

I did that once but with quotes so I guess thats why it didnt work, thanks though

MattF
01-24-2010, 03:48 PM
Or you could just do as Jay suggested and increment it automatically without any phaffing, and use an array for the values.



$x = 0;

[rest of code here]

$_GET['Question'][$x++];



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum