PHP Redirecting
Started by l3lueMage, May 04 2006 05:46 AM
11 replies to this topic
#1
Posted 04 May 2006 - 05:46 AM
Theres to problems, I need to know how to redirect to another page after they click submit and after the PHP needed has executed...and not using the header() function.
#2
Posted 04 May 2006 - 05:58 AM
Here, put this were you want to redirect
<html>
<HEAD>
<script language="JavaScript">
var browserVer=parseInt(navigator.appVersion);
if (browserVer >= 4)
{
window.location= URL HERE
}
else
{
window.location= And Here
}
//-->
</SCRIPT>
</head>
</html>
#3
Posted 04 May 2006 - 06:22 AM
Thanks that worked
#4
Posted 04 May 2006 - 06:27 AM
or if you dont want to use js you can just use meta refresh http://www.pageresou...html/metref.htm
#5
Posted 04 May 2006 - 07:25 AM
yh, use meta refresh instead, works with all browsers and no javascript required.
#6
Posted 04 May 2006 - 07:43 AM
I always though META refresh messed up SEO though "/
#7
Posted 04 May 2006 - 08:10 AM
You dont want google to index a page that executes some kind of script anyway.
#8
Posted 04 May 2006 - 11:01 AM
If I print a message like this:
print("Hello world!");
Should the meta-refresh be before the text (like print("meta - text"); ) or after the text (like print("text - meta); )?
print("Hello world!");
Should the meta-refresh be before the text (like print("meta - text"); ) or after the text (like print("text - meta); )?
#9
Posted 04 May 2006 - 11:29 AM
It doesnt matter where you put it, you put it where you want it to refresh
#10
Posted 04 May 2006 - 01:09 PM
But will it echo the text in both of my examples?
Another question:
My MySQL looks like this "MYSQL_QUERY("SELECT * from users WHERE user='$user'and password='$password'") or die ("Wrong username and/or password.");
How can I insert a meta-refresh in that one?
Another question:
My MySQL looks like this "MYSQL_QUERY("SELECT * from users WHERE user='$user'and password='$password'") or die ("Wrong username and/or password.");
How can I insert a meta-refresh in that one?
#11
Posted 04 May 2006 - 03:12 PM
for the mysql_query() add teh meta tag afteer the mysql_query()
or put a few seconds delay on the meta tag.
--------
being semantically correct though, a meta tag should be between the <head></head> tags or above all other code... but that dosn't really matter for a quick script-execution page does it?
or put a few seconds delay on the meta tag.
--------
being semantically correct though, a meta tag should be between the <head></head> tags or above all other code... but that dosn't really matter for a quick script-execution page does it?
#12
Posted 04 May 2006 - 03:12 PM
What do you mean?
$metaError = '<meta http-equiv="refresh" content="0">';
mysql_query("SELECT * FROM table") or die( $metaError );
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
