edg322 Posted October 18, 2006 Share Posted October 18, 2006 When I submit my form, a blank page is returned back with no content. The form should post back to itself. (The 'action' attribute is the same page)I have the following code at the top of the page:[tt]if(isset($_POST['postback']) && $_POST['postback']=='y' ){ echo "page posted back";} else { echo "page did not post back"; }[/tt]And within my form I have:[tt]<input type="hidden" name="postback" value="y">[/tt]When I first load the page, "page did not post back" is found on the top of the page.However when I submit the form, no content is returned at all. Any suggestions? ??? Quote Link to comment Share on other sites More sharing options...
xsist10 Posted October 18, 2006 Share Posted October 18, 2006 Post all the form code please. Quote Link to comment Share on other sites More sharing options...
alpine Posted October 18, 2006 Share Posted October 18, 2006 Your snippet looks fine to me.If you are doing this just to determine wether a form is posted or not in general, you could sniff for the submit button instead - saving you the trouble of hidden fields:[code]<?phpif(isset($_POST['submit'])){ echo "Form is posted";}echo <<<_HTML<form method="post" action="test.php"><input type="text" name="q" /><input type="submit" name="submit" value="Post this form" /></form>_HTML;?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.