Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. yer, u would have to make the bbcode regex in javascript
  2. I think you need AJAX
  3. do you mean where the bbcode is applied instantly?
  4. 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
  5. change $htmlcode = '<a href=' . $linkurl . '><img src=' . $imgurl . '></a>'; to $htmlcode = '<a href="' . $linkurl . '"><img src="' . $imgurl . '"></a>';
  6. 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.
  7. This would be easy to get past if they have javascript disabled, unless you have all the links disabled to begin with.
  8. 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
  9. or another option <?php if (!$_SESSION['firsttime']) { echo "<center><font size='10' color='#00FFFF' weight='bold'>Welcome</font></center>"; $_SESSION['firsttime'] = true; } ?>
  10. 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
  11. people never read the post near the top about header errors. And click topic solved if solved
  12. 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
  13. 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.
  14. add die to all your querys
  15. first off post all your code
  16. 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']; ?>
  17. ok then add one in PHP my admin or ure database managment program
  18. is the field name correct? and/or try $signature = $userinfo['signature']; // this doesnt
  19. what? your question doesnt make any sense
  20. if you want an easy fix put ob_start(); at the top of the page
  21. Read this http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  22. do you even have a database created on the server?
  23. 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 ?
  24. Are you using a mysql database or mysqli?
  25. 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.