a php form question [closed]
i have this question: creating 2 pages in php the first(index.php) contain a form for inputing first_name and last_name and when you submit the form the url must be like this: http://127.0.0.1:8888/index1.php?boxaction=confirm this for confirming the form(2nd page) now we have still submit and this one for display the form with this url: http://127.0.0.1:8888/index1.php?boxaction=display
sounds like you want to validate input from the form field and you want the form to post back to itself. set your action in your form to point to itself. check the $_POST values for valid responses and then echo the content of those $_POST values to the page. when you first load the page it will need to know not try and echo those $_POST values as you have not submitted the form yet
as for what you are trying to accomplish with ?boxaction=var ... i'm confused.
in a perfect world you would validate this/any form client side using JavaScript and then again using a server side tool - like PHP. the JavaScript enhances user experience but the server side validation (hopefully) prevents script kiddies from wreaking havoc
精彩评论