![]() |
|
#1
|
|||
|
|||
getting variables from $_GET & $_POSTIs there any easy way of extracting GET and POST variables? I'm writing a guest book that will use both get and post methods and wondered what the best method to use is to get these variables.
So far I have used the following code: Quote:
Array ( [0] => name [1] => email [2] => homepage [3] => url [4] => comments ) The only way I can think of is to EXPLODE this, then pick out any array elements like [0] and => so I'm just left with the array keys, then go through these and get the values, which seems very long winded. I have looked through the PHP website and cant find anything that might be useful, so help would be greatly appreciated Thanks in advance Dunc |
|||
|
#2
|
||||
|
||||
|
If your script accepts both (i.e. $_GET and $_POST) you can retrieve the super global array $_REQUEST instead.
Then, about getting these 'extracted', you can read up on the PHP function extract() and see if that does what you want it to do. PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
Thanks for that. It sounds just what I'm looking for. I found the following:
Quote:
But as you can see this has to be done for $_GET and $_POST and my script will use both of these. I will have a tinker with your example when I get back from work. Many thanks Dunc :-) |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing variables out of an iframe by url | JUNK KED | MySQL / PHP Forum | 5 | 31-Jul-2007 10:33 |
| Not finding POST variables | shrdlu | Apache Web Server Forum | 2 | 22-Jan-2004 19:50 |
| Apache on Windows XP and passing variables | Jos Elkink | Apache Web Server Forum | 4 | 21-Nov-2003 03:21 |
| Mail message with variables | ukrspp21 | MySQL / PHP Forum | 2 | 05-Aug-2003 06:10 |
| PHP variables | nniehoff | MySQL / PHP Forum | 7 | 26-Jul-2002 07:25 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The