need php help

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Ask for help you need in the forums, so you can be answered and maybe even others will learn from it.

I thought about messaging you on AIM, but, like I said, post in here first. I'm willing to help.
 

NewFuture

New Member
Messages
1,658
Reaction score
0
Points
0
its complicated, my friends owns a flash site, and on the links to his flash games instead of directing to the actual game he uses some kind of php 'thing' which hides url but loads the game (see link)

hes got HISWEBSITE/game.php?type=puzzle&game=aqua&height=400&width=550

and not the actual url, he told me its some kind of php script, could someone help me make my site work like that? so the location of the game isnt been show but the php link instead.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Ok.. So what exactly do you want to know? Where the games truly are? All that is, is a way to show any game in the one script, depending on the values of the variables in the URL.
 

ak007

Member
Messages
216
Reaction score
0
Points
16
Ahh I Know What he Means Maybe He Wana Hide Real SWF And Make The Page A Little Bit Dynamic By Passing Var From Th Query String It Would me Much Better If You Use database But Without Db here How It looks Like :

PHP:
<?php
if(empty($_GET[name]) || empty($_GET[width]) || empty($_GET[height]) || empty($_GET[quality])){
echo "Direct Access not Allowded!";
exit;
}
//here Come Some Config Stuff
//Replace With Your Site Url With Directory With trailing Flash!!!!!
$basedir = "http://yoursite.com/flashfiles/";
?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="<?=$_GET[width]?>" height="<?=$_GET[width]?>" id="Game" align="middle">
<param name="movie" value="<?=$basedir.$_GET[name]?>.swf" /><param name="quality" value="<?=$_GET[quality]?>" /><param name="bgcolor" value="#ffffff" /><embed src="<?=$basedir.$_GET[name]?>.swf" quality="<?=$_GET[quality]?>" bgcolor="#ffffff" width="<?=$_GET[width]?>" height="<?=$_GET[width]?>" name="Games" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Note :
The URL MUST Look Like This !:
hxxp://site.com/anypgate.php?name=main&width=800&height=400&quality=high

And You Must Upload All You SWF File To The Directory You Specified Above FOR Example
If The name of your swf file you upload is mafia.swf then you must pass the name in the address barlike this:
hxxp://site.com/anypgate.php?name=mafia&width=800&height=400&quality=high

Without The .swf!! Comments And Questions are welcomed !!
And Don't Expect So much From That Script Ive Made It Within 3 minutes ;)
 
Last edited:

NewFuture

New Member
Messages
1,658
Reaction score
0
Points
0
yes great thanx, and no i dont wanna know where the games are, i just wanted to know how he was using the code
 

NewFuture

New Member
Messages
1,658
Reaction score
0
Points
0
ak007 said:
Ahh I Know What he Means Maybe He Wana Hide Real SWF And Make The Page A Little Bit Dynamic By Passing Var From Th Query String It Would me Much Better If You Use database But Without Db here How It looks Like :

PHP:
<?php
if(empty($_GET[name]) || empty($_GET[width]) || empty($_GET[height]) || empty($_GET[quality])){
echo "Direct Access not Allowded!";
exit;
}
//here Come Some Config Stuff
//Replace With Your Site Url With Directory With trailing Flash!!!!!
$basedir = "http://yoursite.com/flashfiles/";
?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="<?=$_GET[width]?>" height="<?=$_GET[width]?>" id="Game" align="middle">
<param name="movie" value="<?=$basedir.$_GET[name]?>.swf" /><param name="quality" value="<?=$_GET[quality]?>" /><param name="bgcolor" value="#ffffff" /><embed src="<?=$basedir.$_GET[name]?>.swf" quality="<?=$_GET[quality]?>" bgcolor="#ffffff" width="<?=$_GET[width]?>" height="<?=$_GET[width]?>" name="Games" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Note :
The URL MUST Look Like This !:
hxxp://site.com/anypgate.php?name=main&width=800&height=400&quality=high

And You Must Upload All You SWF File To The Directory You Specified Above FOR Example
If The name of your swf file you upload is mafia.swf then you must pass the name in the address barlike this:
hxxp://site.com/anypgate.php?name=mafia&width=800&height=400&quality=high

Without The .swf!! Comments And Questions are welcomed !!
And Don't Expect So much From That Script Ive Made It Within 3 minutes ;)

i have pm'd you plz reply
 

NewFuture

New Member
Messages
1,658
Reaction score
0
Points
0
the page on my site www.newfuture.tk with all the catogory images can i still have that on the php page which will be in the iframe?- i also need your help
ak007 vbmenu_register("postmenu_58880", true); so sign into msn plz
 
Last edited:

chitwa

New Member
Messages
128
Reaction score
0
Points
0
Well i think its actually a page called game.php that chooses the game you want according to what you click.

HISWEBSITE/game.php?type=puzzle&game=aqua&height=400&width=550.

In the link above, everything else after 'game.php' is generated by the button you click. It generates data to search the database i.e " type = 'Puzzle' game='aqua'" Its very doable by the way
 

NewFuture

New Member
Messages
1,658
Reaction score
0
Points
0
ha ha, could someone make it work with a database then with all codes and instructions plz?
 
Last edited:

03moscropl

Flash Freak
Messages
698
Reaction score
0
Points
0
i am not good but i recomed in taking a look at this script its really a module but it is cool!

pnflashgames.com
 

03moscropl

Flash Freak
Messages
698
Reaction score
0
Points
0
perhaps you should move it and place it under request and a dd a reward of points that might make pople want to help!:roflwerd:
 

oab

New Member
Messages
918
Reaction score
0
Points
0
okay let me see if i can help you.


each game you have should have a button that says 'click here to play' or somthing, this is the code for the button:
HTML:
<form method="post" action="play.php">
<input name="game" type="hidden" value="name of game"> \\change "name of game" to the name of the game this button is being used for.
<input name="submit" type="Submit" value="Play the Game!" >
</form>
You should create a file named play.php with these contents:
PHP:
<?
$game = $_POST['game'];
 
if ($game == "name of 1st game"){
?>
html code to display game number 1
<?
}
 
elseif ($game == "name of 2nd game"){
?>
html code to display game number 2
<?
}
 
elseif ($game == "name of 3rd game"){
?>
html code to display game number 3
<?
}
 
?>
In this script i used the post action on the form because i am not very familiar with how the get action works, so it wont even have any variables in the url it will always just be play.php, which means you cant bookmark a page with a certain game on it.. which is not very good, if some1 can improve on this it would be great.
 
Top