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.

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.

<?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....

Which is the 3rd page ?

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"];

}

?>

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.