Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: PHP script does not get POST vars |
|
Author |
|
jim houlihan
Joined: 28 Nov 2006 Posts: 3
|
Posted: Tue 28 Nov '06 16:39 Post subject: PHP script does not get POST vars |
|
|
I recently loaded Apache 2 as a testing sever and also loaded Php 5.2.0 which is running in Apache. However when I try to post the text in a text field to another page nothing happens. It seems as if the PHP script is not been read |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7370 Location: Germany, Next to Hamburg
|
Posted: Tue 28 Nov '06 17:39 Post subject: |
|
|
PHP can read it. In PHP 5 are register_globals are off by default. So you have to turn it on in php.ini (not recommend) or you have to use new super globals e.g. $_POST / $_GET.
Code: |
<form action="your.php" method="post">
<input type="text" name="bla1" />
<input type="text" name="bla2" />
</form>
|
your.php
Code: |
<?php
$bla1=$_POST['bla1'];
$bla2=$_POST['bla2'];
?>
|
The old HTTP_*_VARS are turned off by default in PHP 5 and greater!
Can be turned on in php.ini register_long_arrays. Not recomment! |
|
Back to top |
|
jim houlihan
Joined: 28 Nov 2006 Posts: 3
|
Posted: Wed 29 Nov '06 9:16 Post subject: PHP 5 solution |
|
|
Thank you that code worked perfectly and saved me a lot of time and effort |
|
Back to top |
|
|
|
|
|
|