Closed Thread Icon

Topic awaiting preservation: PHP redirect after mysql checks db Pages that link to <a href="https://ozoneasylum.com/backlink?for=22103" title="Pages that link to Topic awaiting preservation: PHP redirect after mysql checks db" rel="nofollow" >Topic awaiting preservation: PHP redirect after mysql checks db\

 
Author Thread
kronk
Obsessive-Compulsive (I) Inmate

From:
Insane since: Jun 2004

posted posted 06-09-2004 05:56

is there a way to run a redirect through php after mysql checks a database???

By that i mean:

a entry via a form is made and the entry is checked in the database, if the id number(entered in form) matches that in the database, redirect to a certain page, if it does not match, redirect to a different page (sorry that id number is already taken)

or is there a better way to do this??? I need an id number validated with the database and then display the id number in the following page.

Any suggestions
Thanks

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 06-09-2004 06:12

I dont think you need a redirect in this situation, you only need redirects in automated things such as sending bulk mail imo.

In this case what i would do, is:
-You enter your ID number and info.
-You press submit.
-The action of the form with the submit button should point to the php page which checks the data (even if it goes back to itself if the script is in the form page)

The php will check the database serverside, then you tell it what to spit out to the browser depending on the result. So you would probably reload the form page or something if it failed with a warning.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-09-2004 07:52

This isn't the way to do this.


Normally with PHP what you would do is include the appropriate content depending on the ID.

You could redirect using the header function however. Make sure with any header function however that you don't echo anything (including a space in front of your opening php tag) before calling the header function.



.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu