Jump to content

Recommended Posts

Hey!

 

i want to open an page in an iframe, but when u click the link it just reloads the page with the main iframe default in it.

 

<a href="\inbox.php\" onclick=\"javascript:document.location.reload();\" target=\"main\">

 

this was my last attempt, but doesny work. any one have any ideas?

Link to comment
https://forums.phpfreaks.com/topic/46703-reload-then-open-in-an-iframe/
Share on other sites

My whole logged in page.

 

<?
session_start();
include "includes/functions.php";
include "includes/db_connect.php"; 
logincheck();
$username=$_SESSION['username'];
$total_regged=mysql_num_rows(mysql_query("SELECT * FROM users"));
$admins=mysql_num_rows(mysql_query("SELECT * FROM users WHERE userlevel='2'"));
$mods=mysql_num_rows(mysql_query("SELECT * FROM users WHERE userlevel='1'"));
$iti=mysql_fetch_object(mysql_query("SELECT * FROM site_stats WHERE id='1'"));
$most=$iti->online;
$currank=$fetch->rank;
$rankp = $fetch->rankpoints;
?>

<?




$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));



?>

<?php 
$check = mysql_query("SELECT * FROM `inbox` WHERE `read`='0' AND `to`='$username'");
$inbox=mysql_num_rows($check);

?>
<?
$query1=mysql_query("SELECT * FROM user_info WHERE username='$username'");
$info=mysql_fetch_object($query1);




$currank=$fetch->rank;
$rankp = $fetch->rankpoints;

if ($currank == "Nobody"){
$max = "100";
$old="0";

}elseif ($currank == "Begger"){
$max = "200";
$old="100";

}elseif ($currank == "Rat"){
$max = '400';
$old="200";

}elseif ($currank == "Bag Head"){
$max = '800';
$old="400";

}elseif ($currank == "Scum"){
$max = '1600';
$old="800";

}elseif ($currank == "Tramp"){
$max = '3200';
$old="1600";

}elseif ($currank == "Paper Boy"){
$max = '6400';
$old="3200";

}elseif ($currank == "Thief"){
$max = '12800';
$old="6400";

}elseif ($currank == "Wannabe Thug"){
$max = '25600';
$old="12800";

}elseif ($currank == "Thug"){
$max = '51200';
$old="25600";

}elseif ($currank == "Whygee"){
$max = '102400';
$old="51200";

}elseif ($currank == "Wankster"){
$max = '204800';
$old="102400";

}elseif ($currank == "Gangster"){
$max = '409600';
$old="204800";

}elseif ($currank == "Drug Dealer"){
$max = '819200';
$old="409600";

}elseif ($currank == "Associate"){
$max = '1638400';
$old="819200";

}elseif ($currank == "Made Man"){
$max = '3276800';
$old="1638400";

}elseif ($currank == "Hitman"){
$max = '6553600';
$old="3276800";

}elseif ($currank == "Underboss"){
$max = '13107200';
$old="6553600";

}elseif ($currank == "Godfather"){
$max = '26214400';
$old="131027200";

}elseif ($currank == "God"){
$max = '52428800';
$old="26214400";

}elseif ($currank == "Legend"){
$max = '104857600';
$old="52428800";

}elseif ($currank == "Scouse Saint"){
$max = '209715200';
$old="104857600";

}
$percent = round((($rankp-$old)/($max-$old))*100);
?>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function profile(url)
{
newwindow=window.open(url,'name','height=385,width=692');
if (window.focus) {newwindow.focus()}
return false;
}

// -->
</SCRIPT>


<SCRIPT language=JavaScript id="disable right clicking">
<!--
document.oncontextmenu=function(){return false};
if(navigator.appName=="Netscape"){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=function(e)
{if(e.which==2||e.which==3)return false}
};

//-->
</SCRIPT>

<script language="javascript">



function Ismell (){
var del = confirm("Are you sure you want to log out?");
if (del == true){
	var loc = "index.php?logout=yes";
	parent.top.location.href=loc;
}
}
function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
   } else {
      obj.style.display="block";
   }
}
</script>


<meta http-equiv="refresh" content="300">
        
<link rel="stylesheet" href="./styles.css" type="text/css">

    

<body background="images/bg.jpg">
<form name="" method="post" >
<table align=center border="1" width="722" height="714" class="tdcell">
<tr>
	<td height="100" width="712" class="tdcell" colspan="2" style="background-image: url('images/banner.jpg')" valign="bottom">
	 </td>
</tr>
<tr>
	<td height="17" width="712" class="tdcell" colspan="2" style="background-image: url('images/banner.jpg')" valign="bottom">
	<font style="font-weight: 700" size="1">Name:</font><font size="1"> <?php echo "$fetch->username"; ?><b>   Rank:</b> <?php echo "$fetch->rank"; ?><b>    Money:</b> <?php echo "£".makecomma($fetch->money).""; ?>
	<b>    Progress: <?php echo "$percent"; ?>%     Energy: <?php echo "$fetch->energy%"; ?>    Location: <?php echo "$fetch->location"; ?>      
	<a href="logged_in3.php" style="text-decoration: none">[Refresh]</a></font></td>
</tr>
<tr>

<head>

</head><?




$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));



?><td height="17" width="177" class="tdcell" style="background-image: url('images/menubg.jpg')">
	<font size="1">Make Money</font></td>


	<td height="483" width="529" class="tdcell" style="background-image: url('images/tdbg.jpg')" rowspan="12">






<font size="1">






<iframe width="529" height="550" src="mainframe.php" name="main" align="middle" border="0" frameborder="0"></iframe>
</font></td>

<tr>
	<td height="82" width="177" class="tdcell" style="background-image: url('images/menubg2.jpg')">
	<p>
	<font color="#000000">
	<a style="text-decoration: none" target="main" href="jack.php">
	<font color="#000000">Car Theft</font></a></font><br>
	<font color="#000000">
	<a style="text-decoration: none" target="main" href="drugs.php">
	<font color="#000000">Drugs</font></a></font><font color="black"><br>
	<font color="#000000">
	<a style="text-decoration: none" target="main" href="bank.php">
	<font color="#000000">Bank</font></a></font><br>
	<font color="#000000">
	<a style="text-decoration: none" target="main" href="mission.php">
	<font color="#000000">Missions</font></a></font><br>
	<font color="#000000">
	<a style="text-decoration: none" target="main" href="ext.php">
	<font color="#000000">Extortion</font></a></font><br>
	<font color="#000000">
	<a style="text-decoration: none" target="main" href="crime.php">
	<font color="#000000">Petty Crime</font></a></font></font></p>
	</td>


	</tr>
<tr>
	<td height="16" width="177" class="tdcell" style="background-image: url('images/menubg.jpg')">
	<b><font size="1">Your Cpanel</font></b></td>


	</tr>
<tr>
	<td height="69" width="177" class="tdcell" style="background-image: url('images/menubg2.jpg')">
	<a target="main" href="user.php" style="text-decoration: none">
	<font color="#000000">Edit Your 
	Profile</font></a><br>
	<a target="main" href="you.php" style="text-decoration: none">
	<font color="#000000">Your Stats</font></a><br>
	<a target="main" href="crew.php" style="text-decoration: none">
	<font color="#000000">Your Crew</font></a><br>
	<a target="main" href="baf.php" style="text-decoration: none">
	<font color="#000000">Buddy List</font></a><br>
	<a target="main" href="garage.php" style="text-decoration: none">
	<font color="#000000">Your Cars</font></a>
	<a target="main" href="rest.php" style="text-decoration: none">
	<br><font color="#000000">Restraunt</font></a>
	</td>


	</tr>
<tr>
	<td height="16" width="177" class="tdcell" style="background-image: url('images/menubg.jpg')">
	<b><font size="1">Message Centre</font></b></td>


	</tr>
<tr>
	<td height="43" width="177" class="tdcell" style="background-image: url('images/menubg2.jpg')">
	<a href=inbox.php onclick="javascript:window.opener.location.reload();" target=main>
	<font color="#000000">Inbox<?php if ($inbox > 0){ echo "<span  style=FONT-WEIGHT:bold>
($inbox)</span>"; } ?>
</font></a><br>
	<a style="text-decoration: none" target="main" href="send2.php">
	<font color="#000000">Compose</font></a>

	<br></a><a href="chat.php" target="main"><span style="text-decoration: none">
	<font color="#000000">Chat</font></span></a>

	</tr>
<tr>
	<td height="16" width="177" class="tdcell" style="background-image: url('images/menubg.jpg')">
	<b><font size="1">War</font></b></td>


	</tr>
<tr>
	<td height="56" width="177" class="tdcell" style="background-image: url('images/menubg2.jpg')">
	<a target="main" href="kill.php" style="text-decoration: none">Kill</a><br>
	<a target="main" href="buy.php" style="text-decoration: none">Buy Weapons</a><br>
	<a target="main" href="sell.php" style="text-decoration: none">Sell Weapons</a><br>
	<a target="main" href="hitlist.php" style="text-decoration: none">Hit List</a>
	<br><a target="main" href="bf.php" style="text-decoration: none">Ammo Shop</a></td>


	</tr>
<tr>
	<td height="16" width="177" class="tdcell" style="background-image: url('images/menubg.jpg')">
	<b><font size="1">Gambling</font></b></td>


	</tr>
<tr>
	<td height="43" width="177" class="tdcell" style="background-image: url('images/menubg2.jpg')">
	<a target="main" href="rr.php" style="text-decoration: none">
	<font color="#000000">Russian Roulette</font></a><br>
	<a target="main" href="race.php" style="text-decoration: none">
	<font color="#000000">Horses</font></a>
	<a target="main" href="slots.php" style="text-decoration: none">
	<br><font color="#000000">Slots</font></a>
	</td>


	</tr>
<tr>
	<td height="16" width="177" class="tdcell" style="background-image: url('images/menubg.jpg')">
	<font size="1"><b>MIsc</b></font></td>


	</tr>
<tr>
	<td height="69" width="177" class="tdcell" style="background-image: url('images/menubg2.jpg')">
	<a target="main" href="jail.php" style="text-decoration: none">
	<font color="#000000">Jail</font></a><br>
	<a target="main" href="fly.php" style="text-decoration: none">
	<font color="#000000">Travel</font></a><br>
	<a style="text-decoration: none" target="main" href="countrys.php">
	<font color="#000000">Owners</font></a><br>
	<a target="main" href="search.php" style="text-decoration: none">
	<font color="#000000">Search A User</font></a><br>
	<a target="main" href="stats.php" style="text-decoration: none">
	<font color="#000000">Game Stats</font></a><br>
	<a href="javascript:Ismell()" style="text-decoration: none">
	Logout</td>


	</tr>

<tr>
	<td height="17" width="712" class="tdcell" style="background-image: url('images/menubg.jpg')" colspan="2">

<font size="1">Users Online</font></td>
</tr>
<tr>
	<td height="4" width="712" class="tdcell" style="background-image: url('images/tdbg.jpg')" colspan="2">











<font size="1">











<?
			$timenow=time();
$select = mysql_query("SELECT * FROM users WHERE online > '$timenow' ORDER BY 'users',`rankpoints` DESC ");
$num = mysql_num_rows($select);
while ($i = mysql_fetch_object($select)){
if ($i->crew == "0"){
$crew="None";
}else{
$crew=$i->crew;
}
if ($i->last_oc > time()){
$oc="No";
}else{
$oc="Yes";
}


if($i->userlevel=="2"){
$echo = "<font color=#D00000>$i->username</font>";
}elseif ($i->userlevel=="1"){
$echo = "<font color=red>$i->username</font>";
}elseif ($i->helper=="1"){
$echo = "<font color=#339900>$i->username</font>";
}else{
$echo = "$i->username";
}
$don=mysql_num_rows(mysql_query("SELECT * FROM donaters WHERE username='$i->username'"));
if ($don != "0"){
$echo .= "<font color=GOLD>*</font>";
}
$rhm=mysql_num_rows(mysql_query("SELECT * FROM crews WHERE rhm='$i->username'"));

if ($rhm != "0"){
$echo = "<i>$echo</i>";

}

$leader=mysql_num_rows(mysql_query("SELECT * FROM crews WHERE owner='$i->username'"));

if ($leader != "0"){
$echo = "<b>$echo</b>";

}
$casino=mysql_num_rows(mysql_query("SELECT * FROM casinos WHERE owner='$i->username'"));

if ($casino != "0"){
$echo = "$echo";

}

$friend=mysql_num_rows(mysql_query("SELECT * FROM friends WHERE person='$i->username' AND type='Friend' AND username='$username'"));
if ($friend != "0"){
$echo = "<font color=yellow>$echo</font>";

}



echo "<a href='profile.php?viewuser=$i->username' target=main> $echo </a>,";
} ?></font></td>
</tr>
</table>

</body>

</html>

This is a better example for you

 

<table>

<tr>

<td>

<iframe id="testiframe" name="main" src="http://www.google.com" width="500" height="500"></iframe>

</td>

</tr>

<tr>

<td>

<a href="#"  onClick="javascript:done()">Link</a>

 

</td>

</tr>

</table>

<script language="javascript">

function done(){

document.getElementById('testiframe').src = "http://www.phpfreks.com/forums";

}

</script>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.