Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Parsing Form Data

General discussions related to php

Moderators: macek, egami, gesf

Postby Joan Garnet » Sun Jun 15, 2003 9:26 am

You have to specify that the variable is an array.
An example

Code: Select all
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="get">
<select name="selection_arr[]" size="5" multiple>
  <option value="one" selected>one</option>
  <option value="two">two</option>
  <option value="three">three</option>
  <option value="four">four</option>
</select>
<input name="Submit" type="submit" value="Send it">
</form>

<?php
if ( isset ( $_GET["selection_arr"] )) {
    print_r ( $_GET [ "selection_arr" ] );
}
?>


Then, if you pass semicolons in variables through URL, they will be parsed as strings.
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Re: Parsing Form Data

Postby WiZARD » Mon Jun 16, 2003 12:39 am

In that situation than a=A;b=B;c=C etc i'm propose use array
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to PHP General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.