kvnirvana Posted August 12, 2010 Share Posted August 12, 2010 This is from a page which opens in Iframe. How do I make this link go to the top of the page above the iframe called index.php when clicked? echo "<li>" . "<p style='font-family:verdana;font-size:150%;'><a href=\"search.php?id=$ID&latinsk=$latinsk\">" .$latinsk . " </a></li>\n</p>"; Quote Link to comment Share on other sites More sharing options...
AtlasC1 Posted August 12, 2010 Share Posted August 12, 2010 I have no idea how that code is relevant to your question. In any case, you don't need javascript. If I understand you correctly, you have an iframe. When the user clicks a link in the iframe, you want the link to affect the parent document (the page that holds the iframe)? You have to use <a href="linkhere.php" target="_parent">text</a> If this isn't the case, please rephrase the question, or someone else will have to help. -jm Quote Link to comment Share on other sites More sharing options...
coffeecup Posted August 12, 2010 Share Posted August 12, 2010 This is from a page which opens in Iframe. How do I make this link go to the top of the page above the iframe called index.php when clicked? echo "<li>" . "<p style='font-family:verdana;font-size:150%;'><a href=\"search.php?id=$ID&latinsk=$latinsk\">" .$latinsk . " </a></li>\n</p>"; here is the static version that could be placed there. <p id="d">dog</p> and then some where else a million lines of text elsewhere <p>A | B | C | <a href="#d">D</a> | E | F | G | .... </p> Quote Link to comment Share on other sites More sharing options...
kvnirvana Posted August 13, 2010 Author Share Posted August 13, 2010 None of the suggestions works the way I want it to. I’ve got this page called index.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE>SearchCare</TITLE> <script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('the_iframe').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('the_iframe').height= the_height; } //--> </script> </HEAD> <BODY > <DIV style="position:absolute;left:0px;top:0px;width:100%;height:100%;z-index:1" align="left"> <TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <img src="sea.jpg" width="1259" height="170" /> </TABLE></DIV> <DIV style="position:absolute;center:0px;top:143px;width:100%;height:100%;z-index:1" align="left"> <TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="1"> <TR> <TD align="left" valign="top" width="122" height="100%"><FONT style="font-size:18px" color="#000000" face="Arial"><B><A href="for.php" target="kasp">For</B></FONT></TD> <TD align="left" valign="top" width="122" height="100%"><FONT style="font-size:18px" color="#000000" face="Arial"><B><A href="igen.php" target="kasp">Si</A></B></FONT></TD> <TD align="left" valign="top" width="160" height="100%"><FONT style="font-size:18px" color="#000000" face="Arial"><B><A href="bedo.php" target="kasp">Be </B></FONT></TD> <TD align="left" valign="top" width="122" height="100%"><FONT style="font-size:18px" color="#000000" face="Arial"><B><A href="ord.php" target="kasp">Ord</B></FONT></TD> <TD align="left" valign="top" width="122" height="100%"><FONT style="font-size:18px" color="#000000" face="Arial"><B><A href="forum.php" target="kasp">Forum</B></FONT></TD> <TD align="left" valign="top" width="122" height="100%"><FONT style="font-size:18px" color="#000000" face="Arial"><B><A href="kontakt.php" target="kasp">Kontakt</B></FONT></TD> </TR> </TABLE></DIV> <DIV style="position:absolute;center:0px;top:165px;width:100%;height:100%;z-index:1" align="left"><TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="1"><TR><TD align="left" valign="top" width="100%" height="40"><FONT style="font-size:16px" color="#000000" face="Arial"><B><hr></B></FONT></TD></TR></TABLE></DIV> <iframe width="100%" id="the_iframe" name="kasp" onLoad="calcHeight();" style="position:absolute;center:1px;top:203px;z-index:2" src="forside.php" scrolling="NO" frameborder="0" height="1"> iframe capable browser is required to view this web site.</iframe> </BODY> </HTML> This is the page called ord.php <?php require('_ting.php'); ?> <html> <head> <link rel="stylesheet" type="text/css" href="noi.css" /> </head> <body> <p> </p> <p style='font-family:verdana;font-size:150%;'> <a href="?by=A">A</a> | <a href="?by=B">B</a> | <a href="?by=C">C</a> |<a href="?by=D">D</a> | <a href="?by=E">E</a> | <a href="?by=F">F</a>| <a href="?by=G">G</a> | <a href="?by=H">H</a> |<a href="?by=I">I</a> | <a href="?by=J">J</a> | <a href="?by=K">K</a>| <a href="?by=L">L</a> | <a href="?by=M">M</a> |<a href="?by=N">N</a> | <a href="?by=O">O</a> | <a href="?by=P">P</a>| <a href="?by=Q">Q</a> | <a href="?by=R">R</a> |<a href="?by=S">S</a> | <a href="?by=T">T</a> | <a href="?by=U">U</a>| <a href="?by=V">V</a> | <a href="?by=W">W</a> |<a href="?by=X">X</a> | <a href="?by=Y">Y</a> | <a href="?by=Z">Z</a>| <a href="?by=Æ">Æ</a> | <a href="?by=Ø">Ø</a> |<a href="?by=Å">Å</a> </p> </body> </html> <?php if(isset($_GET['by'])){ $letter=$_GET['by']; //connect to the database $db=mysql_connect ("localhost", "+++", "+++") or die ('I cannot connect to the database because: ' . mysql_error()); //-select the database to use $mydb=mysql_select_db("k"); //-query the database table $sql="SELECT * FROM fa WHERE latinsk LIKE '$letter%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-count results $numrows=mysql_num_rows($result); echo "</p>"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $latinsk =$row['latinsk']; $ID =$row['id']; //-display the result of the array echo "<ul>\n"; echo "<li>" . "<p style='font-family:verdana;font-size:150%;'><a href=\"search.php?id=$ID&latinsk=$latinsk\"> " .$latinsk . " </a></li>\n</p>"; echo "</ul>"; } } ?> When the user clicks on the link <a href=\"search.php?id=$ID&latinsk=$latinsk\"> It show a new page called search.php. But if the link is at the bottom of the page the new window just stays at the bottom instead of going to the top of the website which is on the page called index.php. Hope this makes sense Quote Link to comment Share on other sites More sharing options...
coffeecup Posted August 13, 2010 Share Posted August 13, 2010 Looks like you may want to ask the PHP side of the forums. it has been awhile since i was in PHP. the static version could be tried in a new doc anchor like this, yet as to how to wprap it in a PHP call with your existing id= target. < a href="new_doc.html#d>d is for the dog</a> " and then at the new_doc page place a id=d wrapped in some element at the top or wherever. Question what does this id link to, id=$ID&latinsk=$latinsk, the whole anchor string is a bullet, if there is PHP code it is usually wrapped in {} . if you look at how the id is being used as a target you may get somewhere ?. Quote Link to comment 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.