okay,
Create a file
gameindex.html with following code
<title> My Game Rox</title>
<frameset cols="*,0" frameborder=0 border=0>
<frame name="imageframe" src="gamegoing.html" noresize scrolling=no>
<frame name="phphidden" src="controlroom.php" noresize scrolling=no>
</frameset>
Now create a file
gamegoing.html with following code
<body>
<div id="character" style="position: absolute; top: 180px; left: 200px"><img src="characterimage.gif"></div>
</body>
Now create another file
controlroom.php with little modified code of wat u found on internet
<script>
var DHTML = (parent.imageframe.getElementById || parent.imageframe.all || parent.imageframe.layers);
function getObj(name)
{
if (parent.imageframe.getElementById)
{
this.obj = parent.imageframe.getElementById(name);
this.style = parent.imageframe.getElementById(name).style;
}
else if (parent.imageframe.all)
{
this.obj = parent.imageframe.all[name];
this.style = parent.imageframe.all[name].style;
}
else if (parent.imageframe.layers)
{
this.obj = parent.imageframe.layers[name];
this.style = parent.imageframe.layers[name];
}
}
var position_top = 200;
var position_left = 180;
function move_up( amount ) {
if ( !DHTML ) return;
var y = new getObj( 'parent.imageframe.character' );
position_top -= amount;
y.style.top = position_top;
}
function move_down( amount ) {
if ( !DHTML ) return;
var y = new getObj( 'parent.imageframe.character' );
position_top += amount;
y.style.top = position_top;
}
function move_left( amount ) {
if ( !DHTML ) return;
var x = new getObj( 'parent.imageframe.character' );
position_left -= amount;
x.style.left = position_left;
}
function move_right( amount ) {
if ( !DHTML ) return;
var x = new getObj( 'parent.imageframe.character' );
position_left += amount;
x.style.left = position_left;
}
</script>
<a href="java script: move_top(20)">TOP</a><br>
<a href="java script: move_left(20)">LEFT</a><br>
<a href="java script: move_down(20)">DOWN</a><br>
<a href="java script: move_right(20)">RIGHT</a><br>
<!-- Also Include your PHP code in this file -->
Include your PHP script in controlroom.php accordingly instead of javascript variables for position. and also keep refreshing controlroom.php not gamegoing.html
There might be a few errors... a little debugging could help
Take Care
TommYNandA