Parsing Form Data

General discussions related to php

Moderators: macek, egami, gesf

User avatar
Joan Garnet
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

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>
<input name="Submit" type="submit" value="Send it">

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
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

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

Return to “PHP General”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests