• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

PHP Code


I put together a small app, but I want to make sure once a person hits the SUBMIT button it redirects to a processing message/page.  Does anyone have a code snippet for this?

  • 3
3 Solutions
Ray PaseurCommented:
When the submit control is fired, the browser will direct all of the form contents to the URL of the action= attribute of the form tag.  It is explained here at PHP.net (See "Dealing with Forms")
Marco GasiFreelancerCommented:
I'm not sure about what you want, but a submit button is usually part of a form so I think you ahve something like this:

<form action="" method="post">
  <input type="checkbox" name="" value="" />
  <input type="radio" name="" value="" />
  <input type="text" name="" value="" />
  <input type="submit" name="submit" value="Submit" />

In order or process form data you have to set the action attribute of the form to the script which does the job:

<form action="myscript.php" method="post">

That's all, but I suppose now you'll ask something about myscript.php... :-)

Ray PaseurCommented:
If the action= attribute of the form tag is empty or omitted, the request will be send to the current URL.  This allows you to put the form script and the action script into the same script file.  Very handy for keeping your work organized!

Merry Christmas wishes to all, ~Ray
Jack_son_Author Commented:
Thanks, everyone.  Yes, what is your script, that would help a lot!

Here is what i have in the code at the bottom, when I hit submit, I would like it to revert to the processing screen since there is a small delay and then go to the next screen:

    <form name="formOnlinePayment" method="post" action="OnlinePaymentConfirmation.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="formOnlinePayment">

<script type="text/javascript">
var theForm = document.forms['formOnlineRequest'];
if (!theForm) {
    theForm = document.formOnlineRequest;
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;


<a class='default' href='javascript:document.forms[0].submit();'>Save Changes</a>
Ray PaseurCommented:
Thanks for the points, ~Ray
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now