logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: PHP script does not get POST vars
Author
jim houlihan



Joined: 28 Nov 2006
Posts: 3

PostPosted: Tue 28 Nov '06 16:39    Post subject: PHP script does not get POST vars Reply with quote

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: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 28 Nov '06 17:39    Post subject: Reply with quote

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

PostPosted: Wed 29 Nov '06 9:16    Post subject: PHP 5 solution Reply with quote

Thank you that code worked perfectly and saved me a lot of time and effort
Back to top


Reply to topic   Topic: PHP script does not get POST vars View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner