Re: Newbie - Redirect to do processing



hajaansh@xxxxxxxxxxxxxx wrote:
Hi there,

I am creating my own php site but am a bit concerned with putting all
form processing into a page that is also displaying stuff (i get
overwhelmed with very long pages and like to separate processing from
displaying for maintainability). I found a possible way of separating
processing through using a redirection such as:

    header("Location:" . mylocation);

so if i was logging into my site instead of going straight to the page
it needs to go to and doing all the post processing there I would have
a "processing page" which would redirect me to the correct location
perhaps depending on what was written. So if the incorrect password was
given it would go to an error page otherwise the user would be
successfully logged in. My processing pages would be in effect the
controller in the MVC pattern.

I don't think the redirecting for the processing using the header() function is neccessarry as the FORM tag in the HTML provides an attribute to specify the location to process the form. You shoud use the action entry of the FORM element for that (see W3C.org site about the FORM element http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.3). So:


<FORM action="/url/to/processing/page/here" method="post">

In the processing script you can then use the header() function to specify the location you want to forward the user to based on the entries that were submitted by the form.

Jonathan
.



Relevant Pages

  • Re: defaultValueAttribute
    ... property that did not specify the defaultvalue attribute, ... value correctly displayed in the IDE. ... > Its an attribute that the VS.NET IDE looks at when displaying your custom ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: Open Password protected pst files programatically
    ... without displaying dialog box. ... "Make sure you specify MDB_NO_DIALOG when calling ... trap the error. ...
    (microsoft.public.office.developer.outlook.vba)
  • Not Display in Global Address List (External Contacts)
    ... Does anyone know how I could bulk create external contacts without displaying ... I used CSVDE to import and did not specify to place into ...
    (microsoft.public.exchange.admin)
  • Newbie - Redirect to do processing
    ... I am creating my own php site but am a bit concerned with putting all ... overwhelmed with very long pages and like to separate processing from ... displaying for maintainability). ... processing through using a redirection such as: ...
    (comp.lang.php)
  • Re: Swing app to Web app
    ... How to create an equivalent web ... > application using HTML table and how to handle displaying 90,000 ... form to specify the starting record rather than have your users scroll ...
    (comp.lang.java.gui)