How to send array by post method
by Gabi SolomonSending array by POST is easyer then you thought
All you need to do is name the variables a certain way :
<form METHOD="post" ACTION="index.php" METHOD="post" METHOD="post"><input TYPE="text" NAME="array[0]" /> <input TYPE="text" NAME="array[1]" /> <input TYPE="submit" NAME="submit" VALUE="Submit" /></form>
in the action file you acces the variable like this
$array=$_POST['array']
also if you don’t care about the array key’s you can even do like this
<form METHOD="post" METHOD="post" ACTION="index.php" METHOD="post" METHOD="post" METHOD="post"> <input TYPE="text" NAME="array[]" />
<input TYPE="text" NAME="array[]" />
<input TYPE="submit" NAME="submit" VALUE="Submit" /> </form>
this way they the array keys will take numeric values starting with 0
Hope this helped someone of a bit of trial and erorr and looking forword to you’re coments
Related Posts
-
George
-
Blah
-
constantmeiring
-
Gabi Solomon
-
tranquillity
-
Gabi Solomon
-
dsf
-
Gabi Solomon
-
Dennis

