Using exit()
stops processing the program. To send a user to another page with PHP, you can use the header()
function with the "Location:" parameter:
header('Location: form.jsp');
Note that you cannot output information (for example, using echo
), and then use the header
function. All conclusion must be made on the page to which you submit them.
If you want to transmit information, for example, the send field, you can send it using the query string parameter, for example:
header('Location: form.jsp?error=abc');
Your JSP page will display an error depending on what abc
meant.
Alternatively, you can use sessions to transfer more complex information to another page. You can find more information about the sessions here .
source share