Problem with sending variables to a diffrent page.

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
badihi
Forum Newbie
Posts: 15
Joined: Sun Jul 05, 2009 1:16 am

Problem with sending variables to a diffrent page.

Post by badihi »

Hello.
I started PHP Programming two days ago!
When I send some variables to a diffrent page by GET method like this:
localhost/b.php?user="Peter"
in b.php page the variabe "user" is not defined.
Can somebody help me?
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Re: Problem with sending variables to a diffrent page.

Post by William »

You need to use the super global array $_GET. So do

Code: Select all

<?php echo $_GET['user']; ?>
instead. http://us.php.net/manual/en/language.va ... lobals.php
Post Reply