|
-
Feb 7th, 2003, 05:53 PM
#1
Thread Starter
Member
post request parameters are lost
I'm using Apache 1.3.12 and php 4.2.2 on win2k! Php webpages
works fine, only post-request parameters are lost when I call new php page.
example:
I have html file:
**********************************
<html>
<head>
</head>
<body>
<form action="my_first.php" method="post"><br>
Name: <input type=text name="name"><br>
<input type=submit value="Go">
</form>
</body>
</html>
**********************************
my_first.php
**********************************
<html>
<head>
</head>
<body>
<?php
echo "Hello " .$name;
?>
</body>
</html>
**********************************
If I write something into Name field and click 'Go', only 'Hello '
is displayed on the next page - .$name has null value.
Can somebody help me? Is there something wrong with Apache
configuration?
Tomaz
-
Feb 7th, 2003, 06:30 PM
#2
PHP Code:
<?php
global $name;
echo "Hello " .$name;
?>
Now?
-
Feb 7th, 2003, 06:34 PM
#3
Thread Starter
Member
-
Feb 8th, 2003, 04:17 PM
#4
Stuck in the 80s
Code:
echo "Hello, " . $_POST['name'] . "!";
-
Feb 8th, 2003, 05:01 PM
#5
Frenzied Member
don't use global mendhak, it is deprecated. what hobo suggested is the answer and is another feature 
what is happing is that register_globals is OFF for secruity reasons in the php.ini file and the only way to access variables sent form one page to the other is by the means of the Super Globals.
$_GET, $_POST, $_REQUEST, $_SESSION, $_FILES
those ar ethe super globals. you can find out more in the php manual at www.php.net
-
Feb 10th, 2003, 04:02 AM
#6
I see, thanks phpman.
Now I'll have to change all the files I made using global.
-
Feb 11th, 2003, 03:31 AM
#7
Thread Starter
Member
I set register_global to "On" in php.ini file and now it works fine.
Thank's for help to all of you!
Tomaz
-
Feb 11th, 2003, 06:22 AM
#8
Originally posted by tompod
I set register_global to "On" in php.ini file and now it works fine.
Thank's for help to all of you!
Tomaz
phpman just pointed out that it would pose a security risk if you keep it on. Why not do Hobo's way?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|