0

1st page .html

window.opener.top.location.href="2nd page.php?vars=" + temp + "&varr=" +temp1;
self.close();

2nd page.php

if(mysql_num_rows($result) > 0) 
{
print "<script>";
print " window.opener.top.location.href='3rd page.php'";
print "</script>";  
}
else
{
print "<script>";
print " window.location='1st page.html'";
print "</script>";  
}

in this code i'm passing javascript variable to 2nd page.php.when i execute it's opening second page with the values i passed but my if loof is not getting executed in 2nd page.because i need the 3rd page content should displayed in this page.

2
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by nav33n
0

but my if loof is not getting executed in 2nd page.

Check your query in page2. See if its correct and it returns atleast 1 record.

0
<?php

session_start();

?>
<html>
<head>
</head>
<body>
<?php
print "<table align='center'><tr><td>Thank u </td></tr>";

echo $_SESSION["un"];

print "<tr><td><a href='page.php'>ViewJob Order</a></td></tr>";

print "<tr><ta><a href='page1.php'>Search Jobs</a></td></tr>";

print "</table>";


?>
</body>
</html>
this code is working.......... when i include


<?php

session_start();

if (!isset($_SESSION["un"])){

header("Location: index.php");

exit();

} else {

$employer_id=$_SESSION["employerid"];

}

?>

i'm not able to redirect to that 3rd page....

0

This is my 3rd page

3rd page.php

<?php

session_start();

?>
<html>
<head>
</head>
<body>
<?php
print "<table align='center'><tr><td>Thank u </td></tr>";

echo $_SESSION["un"];

print "<tr><td><a href='page.php'>ViewJob Order</a></td></tr>";

print "<tr><ta><a href='page1.php'>Search Jobs</a></td></tr>";

print "</table>";


?>
</body>
</html>
this code is working.......... when i include the below code with the 3rd page it's not redirecting to page 3.it will just excute the if condition..


<?php

session_start();

if (!isset($_SESSION["un"])){

header("Location: index.php");

exit();

} else {

$employer_id=$_SESSION["employerid"];

}

?>
0

Where are you redirecting to page3? All I see is redirection to index.php if the session is not set. Is it entering the if loop? Have a print statement, comment the header function and check!

And please, USE code tags.

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.