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
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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.