November 24, 200817 yr I think this is probably pretty much obvious. Basicaly I have a page where there is a php form on every page. (there is probs a much better way of doing this...) and I was under the impression that to post errors on the same page & a thank you message the easiest way of doing it is using PHP SELF. However now i have realized that on the "contact" page i will need another form that i would like to use the same technique.. I assume you can't use PHP SELF twice on one page? Page that might help you visualize what i'm trying to do: example
November 25, 200817 yr You can use it as much as you want. I dont see why not... There are some security issues with PHP SELF though so do Google it and check them out
November 25, 200817 yr Ofc u can use it u are not limited with just one PHP form... If u dont believe us go ahead and try it
November 25, 200817 yr Author hmmm there must be some other error in my code then.. only started using php last week
November 25, 200817 yr For multiple submits Id just use different names on the submit button and in a nutshell u could do something like: if($_SERVER['REQUEST_METHOD'] == 'POST'){ if(isset($_POST['submitbutton1'])){ //play with form 1 } if(isset($_POST['submitbutton2'])){ //play with form2 } } ?> <form action=<?php echo $_SERVER['PHP_SELF'];?>" method="post"> blaaaaaaa Thats litterally the raw elements... Id use a switch personally but you get the idea
Create an account or sign in to comment