Jump to content

[SOLVED] Simple Redirect Problem!


me1000

Recommended Posts

Can someone please help me??  ??? ??? ??? ???

 

if (isset($inType)) {
       $query = "INSERT INTO $sTableName (TYPE, LINK, DATE, DESCRIPTION) VALUES ('$inType', '$inLink', '$inDate', '$inDescription')";
$result = mysql_query($query);
$response = ($result) ? "Record Added" : "Error adding record!"; 
echo $response;
header ("Location: process.php");
   
        
}

 

Everything works great it even comes back and says "Record Added" All data is entered into the Database just like it should be!

 

BUT IT WONT REDIRECT! what am I missing? lol

I have looked at it for about 30 minutes now, maybe some fresh eyes will help!

 

 

Thank You,

 

Link to comment
Share on other sites

try this:

 

if (isset($inType)) {
       $query = "INSERT INTO $sTableName (TYPE, LINK, DATE, DESCRIPTION) VALUES ('$inType', '$inLink', '$inDate', '$inDescription')";
$result = mysql_query($query);
$response = ($result) ? "Record Added" : "Error adding record!"; 
echo '<meta http-equiv=\"refresh\" content=\"3;URL=process.php\">'.$response.'';
   
        
}

 

that will refresh to process.php in 3 seconds

Link to comment
Share on other sites

with php headers you cannot echo anything before the header.

 

Meaning anything you echo has to be after the header() call which people will not see unless you do the refresh header, which you would need to post the echo AFTER the header call either way. Hope that helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.