Ask a Question related to PHP Development, Design and Development.
-
RX #1
Redirection Help Please
I try to use PHP to redirect to other page and failed. Please give me a
help. Thanks.
The script is:
if($rows_num>0)
{
session_start();
session_register("userid");
session_register("username");
session_register("userpriv");
$userid=$data[0]['user_id'];
$username=$data[0]['username'];
$userpriv=$data[0]['priv_id'];
echo "<script
language=javascript>self.location='admin_cpanel.ph p';</script>";
exit;
}
else
{
echo "<script
language=javascript>self.location='admin_login.php ';</script>";
exit;
}
The result is a blank page. No redirection as expected.
RX Guest
-
ASP redirection
Hey, I have an idea and wonder if it's possible I want to have a form page with aboot three different drop down menus. once all the options... -
redirection
Thank you for your hel my question is: How can I redirect a visitor to a HTML site if he does not have flash plugin instaled on his computer? on my... -
URL redirection database
I'm distributing HTML files on a CD. I'd like those files to include URLs that point to a simple database on my ISP IIS server, do a lookup based... -
[PHP] cookies and redirection
> I have a small problem was wondering if anyone out there knew anyhting about Yeah, set the cookie as normal using the header() function (or... -
[PHP] Redirection Question
Hi, I'm not sure if this is going to help or not.. Since I understand your issue only barely.. If I understand correctly, regardless of whether... -
Jedi121 #2
Re: Redirection Help Please
RX a écrit le 20/02/2004 :
I think JavaScript needs double-quotes. Try :> echo "<script
> language=javascript>self.location='admin_cpanel.ph p';</script>";
> exit;
> }
> else
> {
> echo "<script
> language=javascript>self.location='admin_login.php ';</script>";
> exit;
> }
echo "<script
language='javascript'>self.location=\"admin_login. php\";</script>";
Jedi121 Guest
-
Mike Discenza #3
Re: Redirection Help Please
RX wrote:
> I try to use PHP to redirect to other page and failed. Please give me a
> help. Thanks.
>
> The script is:
>
> if($rows_num>0)
> {
> session_start();
> session_register("userid");
> session_register("username");
> session_register("userpriv");
> $userid=$data[0]['user_id'];
> $username=$data[0]['username'];
> $userpriv=$data[0]['priv_id'];
> echo "<script
> language=javascript>self.location='admin_cpanel.ph p';</script>";
> exit;
> }
> else
> {
> echo "<script
> language=javascript>self.location='admin_login.php ';</script>";
> exit;
> }
>
> The result is a blank page. No redirection as expected.
either
self.location.href='newLocation'
or
window.location.href='newLocation'
should work.
Seeing how javascript can be turned off by a person, I wouldn't rely on it
to redirect everyone. Do a bit of research and look for the syntax of a
meta redirect, those are more reliable IMHO.
Mike Discenza Guest
-
Duyet The Vo #4
Re: Redirection Help Please
Try php function header(), ie.
header ( "Location: admin_cpanel.php" );
"RX" <liqiangx@telus.net> wrote in message
news:ptvZb.28246$n17.4865@clgrps13...> I try to use PHP to redirect to other page and failed. Please give me a
> help. Thanks.
>
> The script is:
>
> if($rows_num>0)
> {
> session_start();
> session_register("userid");
> session_register("username");
> session_register("userpriv");
> $userid=$data[0]['user_id'];
> $username=$data[0]['username'];
> $userpriv=$data[0]['priv_id'];
> echo "<script
> language=javascript>self.location='admin_cpanel.ph p';</script>";
> exit;
> }
> else
> {
> echo "<script
> language=javascript>self.location='admin_login.php ';</script>";
> exit;
> }
>
> The result is a blank page. No redirection as expected.
>
>
Duyet The Vo Guest



Reply With Quote

