-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
[SOLVED] php based, AJAX/JavaScript rich text editor ( CMS etc)
DeanWhitehouse replied to PC Nerd's topic in PHP Coding Help
yer, u would have to make the bbcode regex in javascript -
I think you need AJAX
-
[SOLVED] php based, AJAX/JavaScript rich text editor ( CMS etc)
DeanWhitehouse replied to PC Nerd's topic in PHP Coding Help
do you mean where the bbcode is applied instantly? -
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
-
change $htmlcode = '<a href=' . $linkurl . '><img src=' . $imgurl . '></a>'; to $htmlcode = '<a href="' . $linkurl . '"><img src="' . $imgurl . '"></a>';
-
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.
-
This would be easy to get past if they have javascript disabled, unless you have all the links disabled to begin with.
-
[SOLVED] php based, AJAX/JavaScript rich text editor ( CMS etc)
DeanWhitehouse replied to PC Nerd's topic in PHP Coding Help
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 -
or another option <?php if (!$_SESSION['firsttime']) { echo "<center><font size='10' color='#00FFFF' weight='bold'>Welcome</font></center>"; $_SESSION['firsttime'] = true; } ?>
-
[SOLVED] php based, AJAX/JavaScript rich text editor ( CMS etc)
DeanWhitehouse replied to PC Nerd's topic in PHP Coding Help
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 -
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
-
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.
-
add die to all your querys
-
first off post all your code
-
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']; ?>
-
ok then add one in PHP my admin or ure database managment program
-
need help getting variable from query
DeanWhitehouse replied to krispykreme's topic in PHP Coding Help
is the field name correct? and/or try $signature = $userinfo['signature']; // this doesnt -
what? your question doesnt make any sense
-
Header Error (Im not sure if this post is allowed)
DeanWhitehouse replied to Dethman's topic in PHP Coding Help
if you want an easy fix put ob_start(); at the top of the page -
Read this http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
-
do you even have a database created on the server?
-
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 ?
-
Are you using a mysql database or mysqli?
-
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.