[SOLVED] Errors when using $_POST, $_GET and $_SERVER arrays

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Critta
Forum Newbie
Posts: 8
Joined: Fri Jun 24, 2005 1:45 pm

[SOLVED] Errors when using $_POST, $_GET and $_SERVER arrays

Post by Critta »

Whenever I try to use $_POST, $_GET and $_SERVER, I get the error message:

Fatal error: Call to undefined function: array()

I have read in several examples that these should allow me to access form and querystring data but I cannot for the life of me make them work.

Any ideas why this is? Do I need to define something somewhere to make these arrays work.

Cheers in advance.
Last edited by Critta on Sat Jun 25, 2005 8:42 am, edited 1 time in total.
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

are you able to define arrays? try the following

Code: Select all

<?php
$array = array(1, 1, 1, 1,  1, 8 => 1,  4 => 1, 19, 3 => 13);
print_r($array);
?>
Critta
Forum Newbie
Posts: 8
Joined: Fri Jun 24, 2005 1:45 pm

Post by Critta »

Don't worry, I've worked it out... as usual it was a syntax problem :S

still having problems remembering when to use {, [ and ( :oops:

Cheers for the suggestion though!
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

can you add [SOLVED] to your subject?
Critta
Forum Newbie
Posts: 8
Joined: Fri Jun 24, 2005 1:45 pm

Post by Critta »

no worries, done!

now got the project fully working here

hoorah!
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

No quotes for URL tags, it's:

here
Post Reply