darkfox Posted February 18, 2013 Share Posted February 18, 2013 hi guys, i have a problem hope you can help me.. i have a site that uses an iframe to autorefresh the table inside it. i used an <a href> tag to redirect the page, but instead of redirecting the whole page to another site, it only reloads inside the iframe.. here is my code: from my parent page: </div> <Iframe src="tabs/constable.php" width="990" height="600"></Iframe> </div> from my constable.php file inside the iframe: <head> <script type="text/javascript"> function followLink(o) { var a = o.getElementsByTagName('a'); if (a.length > 0) { document.location = a[0].href; } } </script> </head> <table id="table"> <thead> <tr> <th scope="col" class="idnumber">ID Number</th> <th scope="col" class="name">Name</th> <th scope="col" class="gender">Gender</th> <th scope="col" class="timedate">Date of Consultation</th> <th scope="col" class="type">Student/Employee</th> <th scope="col" class="type">annual/walkin</th> </tr></thead><tbody><tr> <tfoot> <tr> <td colspan="6"></td> </tr> </tfoot> <?php $min = 0; include '../init.php'; $quey1="//somequery here"; $result=mysql_query($quey1); mysql_close($connect); $row1 = mysql_num_rows($result); while($row=mysql_fetch_array($result)) { $dd = "../info.php?pid=".$row['idnumbers']."&&nid=".$row['idnurse']."&&type=".$row['type']; echo "<tr><td onclick='followLink(this);'><a href='".$dd."'></a>{$row['idnumbers']}</td> <td onclick='followLink(this);'><a href='".$dd."'></a>{$row['name']}</td> <td onclick='followLink(this);'><a href='".$dd."'></a>{$row['Sex']}</td> <td onclick='followLink(this);'><a href='".$dd."'></a>{$row['date']}</td> <td onclick='followLink(this);'><a href='".$dd."'></a>{$row['Occupation']}</td> <td onclick='followLink(this);'><a href='".$dd."'></a>{$row['type']}</td></tr>"; } echo' </table></br></br>'; include '../init.php'; $quey2="select count(*) from nurse where status = 'notdone'"; $res=mysql_query($quey2); mysql_close($connect); $rowcounter; while($row=mysql_fetch_array($res)) { $rowcounter = $row['count(*)']; } if($rowcounter > 10) { echo '<form action = "next.php" method = "POST">'; echo ' <input type = "image" src="images/Next.png" name = "next" value = "Next">'; echo ' <input type = "hidden" name = "xx" value = "'.$min.'">'; echo ' <input type = "hidden" name = "gg" value = "patientonqueue">'; echo ' <input type = "hidden" name = "num" value = "'.$rowcounter.'">'; echo '</form>'; } $eto = $rowcounter + 10; if($rowcounter >= 10) { echo "<label name = 'dd'> 10 out of ".$rowcounter."</label>"; } ?> hope you guys understand my code and my problem.. thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/274643-how-do-i-redirect-a-parent-page-using-an-a-href-which-is-residing-inside-an-iframe/ Share on other sites More sharing options...
darkfox Posted February 18, 2013 Author Share Posted February 18, 2013 solved it already.. Quote Link to comment https://forums.phpfreaks.com/topic/274643-how-do-i-redirect-a-parent-page-using-an-a-href-which-is-residing-inside-an-iframe/#findComment-1413198 Share on other sites More sharing options...
darkfox Posted February 18, 2013 Author Share Posted February 18, 2013 just comment when you need this post too cheers! Quote Link to comment https://forums.phpfreaks.com/topic/274643-how-do-i-redirect-a-parent-page-using-an-a-href-which-is-residing-inside-an-iframe/#findComment-1413199 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.