davinci Posted May 31, 2006 Share Posted May 31, 2006 Hi,I tried putting together some code so that when someone visits a link off my site it opens the visited site with a frame on top of the page that has my little header. For example: someone clicks on [a href=\"http://mysite.com/visit.php?=http://othersite.com\" target=\"_blank\"]http://mysite.com/visit.php?=http://othersite.com[/a]My Problem: When I click the image of the little "x" in my frame in order to close the frame and show the site without a frame, instead of removing the frame, it removes the visited site instead and brings me to mysite.com/framecontents.php. I believe the code that needs to be modified can be viewed below in framecontents.phpvisit.php looks like this:[code]<?phpinclude 'library/config.php';include 'library/opendb.php';$query = "UPDATE plugs SET clicks = (clicks + 1) WHERE url = '$url'";mysql_query($query) or die('Error, insert query failed');?><title><?=$_GET[title]?> - Brought to you by MySite.com</title><frameset rows='100,*' border=0 frameborder=0 framespacing=0><frame scrolling=no noresize src='framecontents.php'><frame scrolling=yes frameborder=0 src='<?=$_GET[url]?>'></frameset><noframes><body><p>This page uses frames, but your browser doesn't support them.</p></body></noframes>[/code]framecontents.php looks like this:[code]<html><head><title>CJ Link Out V1.0</title><link rel="stylesheet" href="style.css" type="text/css"></head><body topmargin="0" leftmargin="0"><TABLE border="0" cellspacing="0" cellpadding="0" width="100%" height="75"> <TR> <TD> <TABLE border="0" cellspacing="2" cellpadding="1" width="100%"> <TR> <TD width="1%" nowrap> <TD width="1%" valign="center"> <A HREF="<?=$_GET['url']?>" TARGET="_top"><IMG SRC="close.gif" WIDTH="12" HEIGHT="11" BORDER="0" ALT="Remove Frame"></A> </TD> <TD width="99%" valign="center"> <B><? echo ucfirst($show); ?></B> <A HREF="index.php" TARGET="_top"><IMG SRC="neon.gif" class="nob"></a></TD> </TD> <TD width="99%" nowrap> <div align="right"><A HREF="index.php" TARGET="_top">Back to MySite.com </A></div> </TD> </TR> </TABLE> </TD> </TR></TABLE>[/code]Can anyone point out the error?I'm assuming its something wrong with this... Doesn't seem to be pulling the url...[code] <A HREF="<?=$_GET['url']?>" TARGET="_top"><IMG SRC="close.gif" WIDTH="12" HEIGHT="11" BORDER="0" ALT="Remove Frame"></A>[/code]Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/10905-php-files-within-php-files-and-using-_get/ Share on other sites More sharing options...
samshel Posted June 1, 2006 Share Posted June 1, 2006 TryTARGET="_parent" Quote Link to comment https://forums.phpfreaks.com/topic/10905-php-files-within-php-files-and-using-_get/#findComment-40836 Share on other sites More sharing options...
davinci Posted June 1, 2006 Author Share Posted June 1, 2006 [!--quoteo(post=378989:date=Jun 1 2006, 04:33 AM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ Jun 1 2006, 04:33 AM) [snapback]378989[/snapback][/div][div class=\'quotemain\'][!--quotec--]TryTARGET="_parent"[/quote]If you meant:[code]<TD width="1%" valign="center"> <A HREF="<?=$_GET['url']?>" TARGET="_parent"><IMG SRC="close.gif" WIDTH="12" HEIGHT="11" BORDER="0" ALT="Remove Frame"></A>[/code]Still doesn't work. When I click the button, it loads up framecontents.php, instead of othersite.com.Any more ideas? Quote Link to comment https://forums.phpfreaks.com/topic/10905-php-files-within-php-files-and-using-_get/#findComment-40889 Share on other sites More sharing options...
samshel Posted June 1, 2006 Share Posted June 1, 2006 check the url u r passing<?=$_GET['url']?>it must be framecontents.php Quote Link to comment https://forums.phpfreaks.com/topic/10905-php-files-within-php-files-and-using-_get/#findComment-40894 Share on other sites More sharing options...
davinci Posted June 2, 2006 Author Share Posted June 2, 2006 [!--quoteo(post=379051:date=Jun 1 2006, 08:54 AM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ Jun 1 2006, 08:54 AM) [snapback]379051[/snapback][/div][div class=\'quotemain\'][!--quotec--]check the url u r passing<?=$_GET['url']?>it must be framecontents.php[/quote]The url in the browser is [a href=\"http://mysite.com/visit.php?url=http://othersite.com\" target=\"_blank\"]http://mysite.com/visit.php?url=http://othersite.com[/a]When I click the button it takes me to framecontents.php which is my frame but where I want it to go is to [a href=\"http://othersite.com\" target=\"_blank\"]http://othersite.com[/a]...I'm a newbie but it seems as if its trying to pull the from the framecontents.php.Also, when I check the HTML source after clicking the close frame button, instead of the pulled 'url' value it is blank. Quote Link to comment https://forums.phpfreaks.com/topic/10905-php-files-within-php-files-and-using-_get/#findComment-41089 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.