Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Reply to Thread

Post a reply to the thread: How do i redirect error page to index.php if there's an query error?

Your Message

Click here to log in

What color is our footer?

 
 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Rate Thread

You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.

Topic Review (Newest First)

  • 04-09-2012, 05:00 AM
    Yes Man

    How do i redirect error page to index.php if there's an query error?

    I have a php page called sample.php that calls query to databse for a few entries..
    Ex. sample/apple.html sample/banana.html
    If someone were to type sample/xxyxz.html it produces an error even though i have 401 redirect
    because
    $row = mysql_fetch_array($result) or die(mysql_error());

    so how do i set it so if the php can't fetch the array, it goes to index.php instead?
    the thing is 401 redirect only works when it's not query-related. as in example.com/xxxxxyyfad will redirect to example.com
    but if someone types example.com/sample/xdfds.html, it gets an error because of the query.

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •