SirChick Posted August 17, 2007 Share Posted August 17, 2007 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 More sharing options...
Orio Posted August 17, 2007 Share Posted August 17, 2007 I really don't understand the question. Your script shows a form, and if submit was pressed it also includes another php file. Orio. Link to comment https://forums.phpfreaks.com/topic/65517-solved-_post-with-submit-button/#findComment-327144 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 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 https://forums.phpfreaks.com/topic/65517-solved-_post-with-submit-button/#findComment-327150 Share on other sites More sharing options...
SirChick Posted August 17, 2007 Author Share Posted August 17, 2007 topic solved ! i had to add : enctype="multipart/form-data" and onsubmit="return ValidateForm1(this)" to get it working! Link to comment https://forums.phpfreaks.com/topic/65517-solved-_post-with-submit-button/#findComment-327166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.