Jump to content
MakeWebGames

Wonder - Gives Random amount of crystals


TheFallen

Recommended Posts

Hey all , this is my first PHP mccodes mod ( so expect all the errors ;p ) the problem is when I am testing this locally all it is giving me is a blank screen.

A friend suggested to look at the functions but from a first glance I could'nt see anything.

There was a few things at first that I thought was the problem but that did'nt seem to help.

Here's my code: http://pastebin.com/KmGhtYpf

Thanks in advance

Link to comment
Share on other sites

Hey all , this is my first PHP mccodes mod ( so expect all the errors ;p ) the problem is when I am testing this locally all it is giving me is a blank screen.

A friend suggested to look at the functions but from a first glance I could'nt see anything.

There was a few things at first that I thought was the problem but that did'nt seem to help.

Here's my code: http://pastebin.com/KmGhtYpf

Thanks in advance

Try this;

http://pastebin.com/nRGpyjfp

Link to comment
Share on other sites

Turn on error reporting in wamp/xamp/lamp.

Make sure you don't have error_reporting(0); in header/globals.

Thanks for the tip , it seems to moaning about this "

Parse error: syntax error, unexpected '}', expecting ',' or ';' in /var/www/html/wonder.php on line 44"

I'll see what's doing what.

Link to comment
Share on other sites

if ($chance <= 45) {

$crystals = mt_rand(2, 45);

$sql = "UPDATE `users` SET `crystals` = `crystals` + " . $crystals . " WHERE `userid` = " . $ir['userid'];

echo "While you were wondering, you have stumbled across {$crystals} Silver Coins!

<hr />

<a href='wonder.php?action=wonder'>Keep Wondering</a><br />

<a href='wonder.php'>>Head Back</a>";

}

 

Change to:

 

if ($chance <= 45) {

$crystals = mt_rand(2, 45);

$sql = "UPDATE `users` SET `crystals` = `crystals` + '".$crystals."' WHERE `userid` = '".$ir['userid']."'";

echo "While you were wondering, you have stumbled across {$crystals} Silver Coins!

<hr />

<a href='wonder.php?action=wonder'>Keep Wondering</a><br />

<a href='wonder.php'>>Head Back</a>";

}

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