Please help a newbie

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

buzzz
New php-forum User
New php-forum User
Posts: 3
Joined: Fri Feb 21, 2003 11:05 pm

Please help a newbie

Postby buzzz » Fri Feb 21, 2003 11:43 pm

Hi
I am a newbie.I created a simple form which takes name as input and displays that name on a new page.However when i use echo $name of the textfield nothing is displayed.I tried on both apache and IIS with php 4.3.0 on windows.What am I doing wrong?

User avatar
xlordt
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ
Contact:

Postby xlordt » Sat Feb 22, 2003 1:31 am

post your code.. please =)

User avatar
pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Postby pootergeist » Sat Feb 22, 2003 3:49 am

php4.3 would have register_globals set to OFF in the .ini file, therefore accessing variables means having to reference the array then var name.

echo $_POST'name'];
or
echo $_GET['name'];

User avatar
xlordt
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ
Contact:

Postby xlordt » Sat Feb 22, 2003 9:25 pm

actually you first have to add a value to your <INPUT TYPE="text" NAME="username" VALUE=\"" . $_GET['username']>

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Sun Feb 23, 2003 12:10 pm

I wouldn't reccomend having the username within the URL

http://www.php-forum.com/p/viewtopic.php?t=1483

buzzz
New php-forum User
New php-forum User
Posts: 3
Joined: Fri Feb 21, 2003 11:05 pm

Postby buzzz » Sun Feb 23, 2003 7:46 pm

Thanks everyone.Turning the register_globals to on worked.Thanks redcircle ur post is informative and of great help to me.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron