Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. in login.php try having session start at the top. and also add error_reporting(E_ALL); to the top of the page and check if there are any errors and add die statements to the querys
  2. change $htmlcode = '<a href=' . $linkurl . '><img src=' . $imgurl . '></a>'; to $htmlcode = '<a href="' . $linkurl . '"><img src="' . $imgurl . '"></a>';
  3. erm the safest way would be a selection of options . e.g. allow them to select a background colour from a drop down list , instead of allowing them to enter any code.
  4. This would be easy to get past if they have javascript disabled, unless you have all the links disabled to begin with.
  5. what do you mean all this stuff, you will need to set up bbcode in PHP then just save the data in the textarea in the db
  6. or another option <?php if (!$_SESSION['firsttime']) { echo "<center><font size='10' color='#00FFFF' weight='bold'>Welcome</font></center>"; $_SESSION['firsttime'] = true; } ?>
  7. I have never seen a tutorial for this, and if you are as good as you say with Javascript and ajax this should be easy Here is a link to one i started, with little javascript knowledge http://americangangsters.org/bbcode.php Also this is the wrong forum, it has nothing to with php
  8. people never read the post near the top about header errors. And click topic solved if solved
  9. or simple way would be to use sessions , as they will be destroyed when the browser is closed. Or they timeout after 30 minutes i think
  10. This is only advised when the site is running live, not in development. Also your mysql_query's may cause errors if u have set them to die on error.
  11. first off post all your code
  12. this is wrong <?session_start(); include("database.php"); if($_SESSION['username']) { $query = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); } $admin = $row['admin']; ?> it should be , short tag should not be used <?php session_start(); include("database.php"); if($_SESSION['username']) { $query = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'"; $result = mysql_query($query); } $admin = $row['admin']; ?>
  13. ok then add one in PHP my admin or ure database managment program
  14. is the field name correct? and/or try $signature = $userinfo['signature']; // this doesnt
  15. what? your question doesnt make any sense
  16. if you want an easy fix put ob_start(); at the top of the page
  17. Read this http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  18. do you even have a database created on the server?
  19. ok, this is the function i have made <?php function crime_chance() { $userid = $_SESSION['userid'] ; $row = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE ID = '{$userid}'")); $chance = $row['crime_chance']; $random_chance = rand(0,100); echo $random_chance."<br>"; echo $chance; if ($chance >= $random_chance ) { $success = 1; } elseif($random_chance <= $chance) { $success = 0; } if($chance == 100) { $success = 1; } if($success == 1) { echo "<tr><td>Succeeded</td></tr>"; } else { echo "<tr><td>Failed</td></tr>"; } $add = rand(1,2); echo "<tr><td>Percent to add to exp ".$add. "</td></tr>"; } ?> Explanation of the game , what it will be is each time you commit a crime you gain either 1 or 2 percent more experience, and the chance of succeeding is based on how much experience you have. But the script we have i dont think it is very good, am i wrong ?
  20. Are you using a mysql database or mysqli?
  21. I am trying to make a script that will , depending on your experience , you will either succeed or fail. so for example if you have 15.5% experience you have a better chance of winning than if you had less. Any ideas, i cant work out any logic for this.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.