Jump to content

[SOLVED] $_POST with submit button


SirChick

Recommended Posts

Is there a way to check if a script like this i working:

 

<form name="" method="POST" action="" enctype="text/plain" id="Form1">
<input type="submit" id="Button1" name="DoCrime" value="Do Crime" style="position:absolute;left:36px;top:56px;width:75px;height:24px;z-index:0">
<? 
if (isset($_POST['DoCrime'])) {
include('UnderBridgeCrimeScript.php');
}
?>

 

because the script "underbridgecrimescript" works on its own.. but not when included so im thinking its related to this include. Im unsure where the fault lies in this ^ :S

Link to comment
https://forums.phpfreaks.com/topic/65517-solved-_post-with-submit-button/
Share on other sites

yeh the included file creates a variable ... lets say "$test"

 

now back in the main script that has the form ^ i then have:

 

<?= $test ?>

 

but it wont echo it. short tags are turned on as i am using them else where and they show up. So its got to be either not including the file when the user presses submit or the $test isnt being stored across pages.

 

 

<? 
if (isset($_POST['DoCrime'])) {
include('UnderBridgeCrimeScript.php');
}
else {
echo " Error:  docrime not set";
}
?>

 

i put this and the Else occured so its deffinatly relating to my form...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.