View previous topic :: View next topic |
Author |
Message |
Guest
|
Posted: Fri May 03, 2002 9:37 pm Post subject: PHP problem with "unsdefined variables" |
|
|
i have a simple form that method=post with a text field called "user" na danother called "pass". i took this example from a PHP book and it has worked but on this server it doesnt. my page looks like this:
"<?
print("$user");
print("$pass");
?>
and i get
Notice: undefined variable: user in C:\abyss\htdocs\test.php on line 2
Notice: undefined variable: pass in C:\abyss\htdocs\test.php on line 3
i may have made a couple of syntax errors here but the originall is just like in the book so i dont get it! i think it might be the server so thats why im posting
thznx for any help :D
-the whackaxe |
|
Back to top |
|
|
TheLinker -
Joined: 05 Apr 2002 Posts: 165 Location: Oslo, Norway
|
Posted: Fri May 03, 2002 9:41 pm Post subject: Re: PHP problem with "unsdefined variables" |
|
|
Anonymous wrote: | i have a simple form that method=post with a text field called "user" na danother called "pass". i took this example from a PHP book and it has worked but on this server it doesnt. my page looks like this:
"<?
print("$user");
print("$pass");
?>
and i get
Notice: undefined variable: user in C:\abyss\htdocs\test.php on line 2
Notice: undefined variable: pass in C:\abyss\htdocs\test.php on line 3
i may have made a couple of syntax errors here but the originall is just like in the book so i dont get it! i think it might be the server so thats why im posting
thznx for any help :D
-the whackaxe |
What version of PHP are you using ?? |
|
Back to top |
|
|
TheLinker -
Joined: 05 Apr 2002 Posts: 165 Location: Oslo, Norway
|
Posted: Fri May 03, 2002 9:47 pm Post subject: Re: PHP problem with "unsdefined variables" |
|
|
If you are using PHP v4.2, there has been some changes in how to use "external variables"... Read http://www.php.net/release_4_2_0.php for more information.
try this:
Code: |
<?php
echo $_POST["user"];
echo $_POST["pass"];
?>
|
|
|
Back to top |
|
|
Guest
|
Posted: Sat May 04, 2002 9:57 am Post subject: thanks |
|
|
looks like i'm gonna have to get myself a newbool if all this isnt working anymore :p
thanks fer the help |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat May 04, 2002 11:44 pm Post subject: Re: PHP problem with "unsdefined variables" |
|
|
TheLinker wrote: | If you are using PHP v4.2, there has been some changes in how to use "external variables"... Read http://www.php.net/release_4_2_0.php for more information.
try this:
Code: |
<?php
echo $_POST["user"];
echo $_POST["pass"];
?>
|
|
Another solution: If you have PHP scripts written using the old fashion and do not have time to convert them, edit your php.ini file, locate the line
Code: |
register_globals = Off
|
and change it to
Code: |
register_globals = On
|
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
AlexBGD -
Joined: 30 May 2002 Posts: 1
|
Posted: Thu May 30, 2002 1:52 am Post subject: Re: PHP problem with "unsdefined variables" |
|
|
I have the same problem, and I tried register_globals=On and it still won't work. I am using PHP 4.2 I don't know much about PHP but I tried display_errors=Off in php.ini and it works fine now. |
|
Back to top |
|
|
E-Oreo -
Joined: 18 Apr 2002 Posts: 17
|
Posted: Wed Jun 05, 2002 10:57 pm Post subject: but |
|
|
but all that did was turn the error display off, that means the errors are still there it just dosn't show them, it didn't work for me either. |
|
Back to top |
|
|
bullseye Guest
|
Posted: Sun Jun 09, 2002 6:27 pm Post subject: another problem with undefined variable |
|
|
After installing PHP 4.02 on abyss I had some problems but with your help I managed to resolve them..
Noe, after a while, with the php.ini file in windows directory I get almost in every php script file the following message:
Quote: | Error undefined variable in ... |
(and so for every variable in the php file)
and when I delete the php.ini in windows dir. (although I shouldn't) [b]the server interprets the php but the actions (ex: execute a command in php to go to another php page) doesn't work :x .
Also the php is interpreted by the server but only in some cases.
Please help with this matter :)
national.is.edu.ro webmaster |
|
Back to top |
|
|
|