I have a script that puts together a page but when I insert code into a form are on the site it doesnt work here is the code I would like to have inserted
<form>
<textarea cols=60 rows=4 style="width: 97%; height: 100px"><a href="http://googlegameroom.com/play/<?= $d["url"] ?>" target="_blank"><?= htmlentities( $d["description"] ) ?></a><br><embed src="/swf/game_<?= $r["id"] ?>.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="<?= $width ?>" height="<?= $height ?>" ?>.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="515" height="412"></embed><br>Powered by: <a target="_blank" href="http://www.googlegamerooom.com">Google Gameroom</a></textarea>
</form>
Original code or script:
<?php
$db->query( "SELECT * FROM games WHERE url='".$db->escape( $_GET["sub"] )."' LIMIT 1" );
$r = $db->fetch();
define( "DOC_TITLE", $r["title"] );
define( "DOC_ADS", true );
if ( $is_guest )
{
if ( !isset( $_COOKIE["credits"] ) )
{
setcookie( "credits", 5, time()+(24*3600*30), "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) );
$_COOKIE["credits"] = 5;
}
if ( $_COOKIE["credits"] > 0 && $_COOKIE["credits"] <= $startup_credits )
{
setcookie( "credits", $_COOKIE["credits"], time()-9999, "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) );
setcookie( "credits", $_COOKIE["credits"] - 1, time()+(24*3600*30), "/", str_replace( "www.", ".", $_SERVER["HTTP_HOST"] ) );
$_COOKIE["credits"] -= 1;
?>
<h1><?= htmlentities( $r["title"] ) ?></h1>
<div align="center" style="border: 1px solid #4f8dac; padding: 10px;">
<strong>You have <?= $_COOKIE["credits"] ?> play credits left!</strong> To get unlimited credits, <a href="/register?ref=<?= urlencode( $_SERVER["REQUEST_URI"] ) ?>">register</a> or <a href="/login?ref=<?= urlencode( $_SERVER["REQUEST_URI"] ) ?>">login</a>!
</div>
<?php
}
else
{
?>
<h1>out of credits</h1>
You must <a href="/register?ref=<?= urlencode( $_SERVER["REQUEST_URI"] ) ?>">register</a> or <a href="/login?ref=<?= urlencode( $_SERVER["REQUEST_URI"] ) ?>">login</a>
to play more games!<br />
<br />
<div align="center">
<div style="width: 220px; border: 1px solid #ccc; padding: 10px;" align="right">
<form action="/login" method="post">
<input type="hidden" name="ref" value="<?= htmlentities( $_SERVER["REQUEST_URI"] ) ?>" />
Username:
<input type="text" name="username" class="in" style="width: 140px; font-size: 12px;" value="<?= htmlentities( $_POST["username"] ) ?>" /><br />
<br />
Password:
<input type="password" name="password" class="in" style="width: 140px; font-size: 12px;" /><br />
<br />
<table width="220" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<?php
if ( isset( $_POST["remember"] ) )
$checked = $_POST["remember"] == 1? " checked=\"checked\"" : "";
else
$checked = " checked=\"checked\"";
?>
<input type="checkbox" id="remember" style="font-size: 10px;" value="1" name="remember"<?= $checked ?> />
<label for="remember">Remember me?</label>
</td>
<td style="text-align: right;">
<input type="submit" value="Login" class="b" style="font-size: 12px;" />
</td>
</tr>
</table>
</form>
</div>
<br />
<small>Not registered? <a href="/register?ref=<?= urlencode( stripslashes( $_REQUEST["ref"] ) ) ?>">Click here</a></small>
</div>
<?php
$dont_output = true;
}
}
else
{
if ( $user["last_play"] < ( time() - 5 ) )
{
$plays = $user["plays"] + 1;
$plays_detailed = unserialize( $user["plays_detailed"] );
$plays_detailed[$r["id"]] = isset( $plays_detailed[$r["id"]] )? $plays_detailed[$r["id"]] + 1 : 1;
$plays_detailed = $db->escape( serialize( $plays_detailed ) );
$db->query( "UPDATE members SET plays=$plays, plays_detailed='$plays_detailed',".
" last_play=UNIX_TIMESTAMP(), last_game=".$r["id"]." WHERE id=".$user["id"]." LIMIT 1" );
$db->query( "SELECT * FROM members WHERE ( plays > ".$plays." ) OR ( plays = ".$plays." AND id <= ".$user["id"]." )" );
$rank = $db->countRows();
if ( $rank < $user["highest_rank"] )
$db->query( "UPDATE members SET highest_rank=$rank WHERE id=".$user["id"]." LIMIT 1" );
}
?>
<h1><?= htmlentities( $r["title"] ) ?></h1>
<?php
if ( $user["plays"] < $plays_required_for_no_ads )
{
?>
<div align="center" style="border: 1px solid #4f8dac; padding: 10px;">
<strong>Find big chunky adverts annoying?</strong> To get rid of ads, get your play count up to <strong><?= number_format( $plays_required_for_no_ads ) ?></strong>!
</div>
<?php
}
?>
<?php
}
if ( !isset( $dont_output ) )
{
$db->query( "UPDATE games SET plays=plays+1, today_plays=today_plays+1 WHERE id=".$r["id"] );
?>
<br />
<div id="side">
<strong><?= htmlentities( $r["title"] ) ?></strong><br />
<br />
<div>
<img src="/thumbs/game_<?= $r["id"] ?>" width="50" height="50"
style="border: 1px solid #000; float: left; margin: 0px 5px 5px 0px;" />
<?= htmlentities( $r["description"] ) ?>
<p>
</p>
<p>
<script language="Javascript">
function openWin()
{
window.open('/swf/game_<?= $r["id"] ?>.swf','NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=790,height=600');
}
</script>
</font>
<a href="JavaScript:openWin()"><font size="5" color="#FF0000">Play Full Screen</font></a></b>
</p>
</div>
<br />
<?php
$db->query( "SELECT * FROM members WHERE favourite=".$r["id"] );
$favourites = $db->countRows();
?>
This game has been played <strong><?= number_format( $r["plays"] + 1 ) ?></strong> times,
and is <strong><?= $favourites ?></strong> peoples' favourite game.
</div>
<div id="content-column">
<?php
$dim = getimagesize( "swf/game_".$r["id"].".swf" );
// 515
if ( $dim[0] > 515 )
{
$height = $dim[1] / ( $dim[0] / 515 );
$width = 515;
}
else
{
$width = $dim[0];
$height = $dim[1];
}
?>
<div style="width: 515px;" align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="<?= $width ?>" height="<?= $height ?>">
<param name="movie" value="/swf/game_<?= $r["id"] ?>.swf" />
<param name="quality" value="high" />
<embed src="/swf/game_<?= $r["id"] ?>.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="<?= $width ?>" height="<?= $height ?>"></embed>
</object>
</div>
<br />
<br />
<table width="97%">
<tr>
<td width="56%" style="padding-right: 3%; border-right: 1px solid #ccc;">
if you liked this game, then you might like the following:<br />
<br />
<table width="97%">
<tr>
<td width="55" valign="top"><img src="/thumbs/game_<?php $x = $r; $d = $db->query( "SELECT * FROM games ORDER BY RAND()" ); $r = $db->fetch(); print $r["id"]; ?>" alt="" width="50" height="50" style="border: 1px solid #000;" /></td>
<td valign="top">
<?= $listing_ad_code ?>
</td>
</tr>
<?php
$db->query( "SELECT * FROM games WHERE category=".$x["category"]." ORDER BY RAND() LIMIT 4" );
while ( $d = $db->fetch() )
{
?>
<tr>
<td valign="top"><a href="/play/<?= $d["url"] ?>"><img src="/thumbs/game_<?= $d["id"] ?>" alt="<?= htmlentities( $d["title"] ) ?>" width="50" height="50" style="border: 1px solid #000;" /></a></td>
<td valign="top" style="padding-left: 4px; font-family: Verdana;">
<strong><a href="/play/<?= $d["url"] ?>" style="font-size: 11px; color: #4F8DAC; text-decoration: underline;"><?= htmlentities( $d["title"] ) ?></a></strong><br />
<small style="font-size: 10px;"><?= htmlentities( $d["description"] ) ?></small><br />
<div align="right" style="font-size: 10px; padding-right: 4px;"><a href="/play/<?= $d["url"] ?>" style="color: #000; text-decoration: underline;">Play Game »</a></div>
</td>
</tr>
<?php
}
?>
</table>
</td>
<td width="44%" style="padding-left: 3%;">
please <a href="/tellafriend?url=<?= urlencode( $_SERVER['REQUEST_URI'] ) ?>">tell your friends</a>
about this page!
</td>
</tr>
</table>
</div>
<?php
}
?>
Now when I make a form and insert it into the main script it doesnt query the game info to the form does a form work like an iframe? What must I do to get it to work? I am not good at php that is obvious I added a full screen button to the script that took me 24 hours so this is my last mod to the site.
working form on shock arcade http://www.shockarcade.com/play/aim-and-fire
See the text area under the game that allows people to cut and paste the game to there site? that is what I am trying to add to my site so others can put the game on there site but the form isnt working correctly.
My site http://googlegameroom.com