Help - Search - Members - Calendar
Full Version: Simple php script won't work
The Planet Forums > Control Panels > Plesk
Joor
I just got a plesk server and now I am having a hell of a time getting variables posted back to the php page once submitted. I can't get the script to read the variable after it has been submitted. Basically the text doesn't get printed to screen. I have no problem with this on ensim, this is so basic that I am lost. Running 4.3.10 php and httpd-2.0.46-44.ent

CODE
<?PHP

if ($btnSubmit != "") {

    echo "You have pressed the submit button";

}

?>



<form method="POST" action="<? print $_SERVER['SCRIPT_NAME'];?>">

<input type="submit" name="btnSubmit" value="push me">

</form>
texasweb
check register_globals = On
Joor
Love you
jonotron
This is generally a bad habit to get into. Ideally register_globals should be turned off and using PHP's _POST, _GET, and/or _REQUEST variables is a better method.

Consider doing this:
CODE
if ($_POST['btnSubmit'] != "") {

    echo "You have pressed the submit button";

}

?>



<form method="POST" action="<? print $_SERVER['SCRIPT_NAME'];?>">

<input type="submit" name="btnSubmit" value="push me">

</form>


Read here for more security details: http://www.php.net/manual/en/security.globals.php
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.