Jump to content
MakeWebGames

Need some help with PHP :)


mxyi

Recommended Posts

OK, so im trying to convert MCC v2 mods (or any other version) into a WTM (Way Of The Mafia) script, but im having alot of trouble,

i tried converting an arcade mod into a WTM script but it just threw me a blank page,

americawars.exofire.net/arcade.php

thecode is

<?php
session_start();
include"includes/db_connect.php";
include"includes/functions.php";
logincheck();
$query=mysql_query("SELECT * FROM users WHERE username='$username'");
$fetch=mysql_fetch_object($query);

$games=array(
'bejeweled'=>array('name'=>'Bejeweled', 'url'=>'http://www.freegames4all.net/swf/Bejeweled.swf', 'h'=>'365', 'w'=>'499'), 
'blackjack'=>array('name'=>'Blackjack', 'url'=>'http://www.freegames4all.net/swf/20323.swf', 'h'=>'500', 'w'=>'500'), 
'chess'=>array('name'=>'Chess', 'url'=>'http://www.freegames4all.net/swf/21337.swf', 'h'=>'500', 'w'=>'500'), 
'ewoks'=>array('name'=>'Ewoks', 'url'=>'http://www.freegames4all.net/swf/20295.swf', 'h'=>'500', 'w'=>'500'), 
'pacman'=>array('name'=>'Pacman', 'url'=>'http://www.zemnetmedia.com/games/pacman/pacmangame.swf', 'h'=>'470', 'w'=>'470'), 
'poker'=>array('name'=>'Poker', 'url'=>'http://www.freegames4all.net/swf/20493.swf', 'h'=>'500', 'w'=>'500'), 
'streetfighter'=>array('name'=>'Street Fighter', 'url'=>'http://www.freegames4all.net/swf/20643.swf', 'h'=>'500', 'w'=>'500'), 
);

if (!$_GET['action']) {
print "<center>Welcome "$username
echo " to the arcade.

All these games are for fun and they will not give any money.</center>
<center><h3>Game List</h3></center>
<table>
<tr><td>[url='arcade.php?action=bejeweled']Bejeweled[/url]</td></tr>
<tr><td>[url='arcade.php?action=blackjack']BlackJack[/url]</td></tr>
<tr><td>[url='arcade.php?action=chess']3D Chess[/url]</td></tr>
<tr><td>[url='arcade.php?action=ewoks']Ewoks[/url]</td></tr>
<tr><td>[url='arcade.php?action=pacman']PacMan[/url]</td></tr>
<tr><td>[url='arcade.php?action=poker']Poker[/url]</td></tr>
<tr><td>[url='arcade.php?action=streetfighter']Street Fighter II[/url]</td></tr>
</table>

[url='explore.php'][Go Back To The City][/url]

";
} else {
print "<center>Welcome "$username" to ".$games[$_GET['action']]['name']."</center>
";
print "<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='".$games[$_GET['action']]['w']."' height='".$games[$_GET['action']]['h']."'>
<param name='movie' value='".$games[$_GET['action']]['url']."'><param name='quality' value='high'>
<embed src=''".$games[$_GET['action']]['url']."'' width='".$games[$_GET['action']]['w']."' height='".$games[$_GET['action']]['h']."' align='center' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>
</object>

[url='arcade.php'][Go Back To The Arcade Home][/url]";
}

?>

please help me fix this i dont see whats wrong with it and why it gives me blank page! D:

Link to comment
Share on other sites

Line 20 >> print "<center>Welcome "$username

change to

print "<center>Welcome $username</center>";

see if that helps

Also line 36 >>> print "<center>Welcome "$username" to ".$games[$_GET['action']]['name']."</center>

";

change to

print "<center>Welcome $username to ".$games[$_GET['action']]['name']."</center>

";

Link to comment
Share on other sites

If you cant see errors on your script as Alain pointed out your php.ini isnt set up to show them however if you dont have access to php.ini

then you can try one of these from http://php.net/manual/en/function.error-reporting.php

 

<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (see changelog)
error_reporting(E_ALL);

// Report all PHP errors
error_reporting(-1);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?> 

 

Just place one from the above list and place in your file just after <?PHP

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...