Monk3h
-
Posts
223 -
Joined
-
Last visited
Never
Posts posted by Monk3h
-
-
Im trying to put an if string inside a variable define string.
Any ideas on the syntax?
Example:
$key = "Empty"; $keycheck = if ($key == 'Empty'){ // Line 7 Print "<img src=images/keyneautural.php>"; };
Error:
Parse error: syntax error, unexpected T_IF in /home/monk3h/public_html/projectalpha/alphaground.php on line 7
-
All my crons worked perfectly for a few days at a time and then sudinly this happends for hours at a time.. :S
this has nothing to do with me changing and scripts, it usualy happends randomly at no specific time.
-
Any help?
Last time it was my Hosters Fault..
Has anyone had this problem before?
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 478 100 478 0 0 73640 0 --:--:-- --:--:-- --:--:-- 73640 100 478 100 478 0 0 72292 0 --:--:-- --:--:-- --:--:-- 0 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>406 Not Acceptable</title> </head><body> <h1>Not Acceptable</h1> <p>An appropriate representation of the requested resource <File Location Removed For Security> could not be found on this server.</p> <hr> <address>Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8b DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at <File Location Removed For Security> <Port Location Removed For Security></address> </body></html>
-
How can i tell if 2 people playing my game are using the same internet browser?
Is there any way to track the cookies?
-
Is there a way to get an options name thru php? I have the value us auto classed as $value, but how do i get the actual Options name.
<select><option value=masterruby>Master Ruby(s)</option></select>
For example, i want to be able to select the name Master Ruby(s) thu a $variable, the list is very long, and right now when the form has finished it reads out the value name which is masterruby, this looks very un tidey.
-
Yes i ment cheating *i'm high*..
Thanks for the help, i'll see what i can make with Java Script.
-
But is there a way to just stop people from being able to refresh?
-
How would i stop people from refreshing on my site? Is there somthing i can put in my header so that if some one does refresh it just redirects them to my index.php page?
Some one is chating by refreshing the same page and i need to stop em ASAP.
-
That wont fix a thing as the { and } are even, its the first thing i always check.
I was gettoing an error because i used an elseif where only an if was required. (stoned)
Thanks for your help.
-
Iv modified my post to include the line number error and i have notated the line in the code.
Full error: Parse error: syntax error, unexpected T_ELSEIF in /home/monk3h/public_html/gemstore.php on line 69
-
I dont understand what iv done wrong here?
Error is on line 69
<?php $title = "Gem Store"; include("header.php"); ?> <b>Store Owner:</b> Welcome to my store! Here you can <i>Buy</i> and <i>Sell</i> many different Priceless Stones..<br><br><br> <?php if ($stat[gembag] == 0 ) { Print "<b>Store Assistant:</b> You dont appear to have a <i>Gem Bag</i>! How do you expect to collect all the precious stones that are available in this wonderful Town?<br><br>"; Print "<b>Store Assistant:</b> The only way to get a Gem Bag is from a certain person in Silverlake.<br><br>"; Print "[<A href=tricity.php>Back to Town?</a>]"; include("footer.php"); exit; } else { Print "<b>Store Assistant:</b> How are you getting on with that "; if ($stat[gembag] == 1) { print "<i>Small Gem Bag</i>"; } if ($stat[gembag] == 2) { print "<i>Gem Bag</i>"; } print "?<br> Normally you could upgrade that tiny thing! (For a Small Fee) But right now we are out of Stock.<br><br><br>"; Print "[<a href=gemstore.php?view=smith>Visit the Gem Smith</a>] [<A href=tricity.php>Back to Town</a>]"; if ($view == smith) { print "<br><br><br><br><b>Gemsmith:</b> I suppose you want me to turn them Puny things into something a little.. Bigger? Well its gonna cost ya <i>250</i> Credits Per Medium and <i>1000</i> Credits per Large. I must warn you, Gem smithing isnt an exact Science, things tend to go wrong.. at your Expense!"; Print "<br><br>[<a href=gemstore.php?view=topaz>Topaz</a>] [<a href=gemstore.php?view=emerald>emeralds</a>] [<a href=gemstore.php?view=ruby>Rubys</a>] [<a href=gemstore.php?view=sapphire>Sapphires</a>]"; if ($stat[shaman] >= { print "<br><br><a href=gemstore.php?view=work>Work for the Gem Smith</a>"; } } if ($view == topaz) { Print "<br><br><br><br>You currently have <b>$stat[scrystals] Small Topaz</b> and <b>$stat[mcrystals] Medium Topaz</b> in your Possesion.<br><br>What would you like to do?<br><br><br></b>"; Print "[<a href=gemstore.php?step=mtopaz>Make a Medium Topaz</a>]"; if ($stat[gsmith] == 1) { print " [<a href=gemstore.php?step=ltopaz>Make a Large Topaz</a>]"; } } if ($step == mtopaz) { if ($stat[credits] < 250){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[scrystals] < 10){ Print "<br><br><br><br>You only have $stat[scrystals] Topaz. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set scrystals=scrystals-10 where id=$stat[id]"); mysql_query("update players set mcrystals=mcrystals+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Medium Topaz</i>!"; }} if ($step == ltopaz) { elseif ($stat[credits] < 1000){ // ERROR Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[mtopaz] < 10){ Print "<br><br><br><br>You only have $stat[mcrystals] Topaz. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set mcrystals=mcrystals-10 where id=$stat[id]"); mysql_query("update players set lcrystals=lcrystals+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Large Crystal</i>!"; }} if ($view == emerald) { Print "<br><br><br><br>You currently have <b>$stat[semeralds] Small Emeralds</b> and <b>$stat[memeralds] Medium Emeralds</b> in your Possesion.<br><br>What would you like to do?<br><br><br></b>"; Print "[<a href=gemstore.php?step=memerald>Make a Medium Emeralds</a>]"; if ($stat[gsmith] == 1) { print " [<a href=gemstore.php?step=lemerald>Make a Large Emeralds</a>]"; } } if ($step == memerald) { if ($stat[credits] < 250){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[semeralds] < 10){ Print "<br><br><br><br>You only have $stat[semeralds] Emeralds. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set semeralds=semeralds-10 where id=$stat[id]"); mysql_query("update players set memeralds=memeralds+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Medium Emerald</i>!"; }} if ($step == lemerald) { if ($stat[credits] < 1000){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[memeralds] < 10){ Print "<br><br><br><br>You only have $stat[memeralds] Emeralds. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set memeralds=memeralds-10 where id=$stat[id]"); mysql_query("update players set lemeralds=lemeralds+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Large Emerald</i>!"; }} if ($view == ruby) { Print "<br><br><br><br>You currently have <b>$stat[srubys] Small Rubies</b> and <b>$stat[mrubys] Medium Rubiess</b> in your Possesion.<br><br>What would you like to do?<br><br><br></b>"; Print "[<a href=gemstore.php?step=mruby>Make a Medium Rubys</a>]"; if ($stat[gsmith] == 1) { print " [<a href=gemstore.php?step=lruby>Make a Large Rubys</a>]"; } } if ($step == mruby) { if ($stat[credits] < 250){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[srubys] < 10){ Print "<br><br><br><br>You only have $stat[srubys] Rubys. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set srubys=srubys-10 where id=$stat[id]"); mysql_query("update players set mrubys=mrubys+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Medium Ruby</i>!"; }} if ($step == lruby) { if ($stat[credits] < 1000){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[mrubys] < 10){ Print "<br><br><br><br>You only have $stat[mrubys] Rubys. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set mrubys=mrubys-10 where id=$stat[id]"); mysql_query("update players set lrubys=lrubys+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Large Ruby</i>!"; }} if ($view == sapphire) { Print "<br><br><br><br>You currently have <b>$stat[ssapphires] Small Sapphires</b> and <b>$stat[msapphires] Medium Sapphires</b> in your Possesion.<br><br>What would you like to do?<br><br><br></b>"; Print "[<a href=gemstore.php?step=msapphire>Make a Medium Sapphires</a>]"; if ($stat[gsmith] == 1) { print " [<a href=gemstore.php?step=lsapphire>Make a Large Sapphires</a>]"; } } if ($step == msapphire) { if ($stat[credits] < 250){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[ssapphires] < 10){ Print "<br><br><br><br>You only have $stat[ssapphires] Sapphires. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set ssapphires=ssapphires-10 where id=$stat[id]"); mysql_query("update players set msapphires=msapphires+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Medium Sapphire</i>!"; }} if ($step == lsapphire) { if ($stat[credits] < 1000){ Print "<br><br><br>You only have $stat[credits] Credits. Thats not enough!"; include ("footer.php"); } elseif ($stat[msapphires] < 10){ Print "<br><br><br><br>You only have $stat[msapphires] Sapphires. Thats not enough!"; }else{ mysql_query("update players set credits=credits-250 where id=$stat[id]"); mysql_query("update players set msapphires=msapphires-10 where id=$stat[id]"); mysql_query("update players set lsapphires=lsapphires+1 where id=$stat[id]"); Print"<br><br><br><b>Success!!</b>.. You gained <i>1 Large Sapphire</i>!"; }} include("footer.php"); exit; } ?> <?php include("footer.php"); ?>
Am i using Else if in an incorect way?
-
Im currently working on a reset script that will reset every feild in the players table to tthere default Value.
My original plan was to use.
mysql_query("update players set feild=defaultvalue");
And make one of them for every single feild in the table.
Is there a faster way too do this? a built in value that sets a table back to its default values maybie?
-
Whats the point in that?
It will just make programming take allot longer.. :S
-
Why doesnt this script work when i type in teh right pass.
When i type the right pass in it still gives me the Wrong password message. :@
<?php $title = "MASTER RESET"; include("header.php"); ?> <?php if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } Print"<form method=post action=masterreset.php?step=reset> Password: <input type=text name=pass></form>"; if ($step == reset){ if ($pass != abc){ Print "Wrong Password"; }else{ Print"Password Correct!"; }} ?> <?php include("footer.php"); ?>
-
I have a problem in my forum script. I am using a string replace function on my forums to remove any and all HTML. My problem is, it seems to be doing this to BB codes as well.
I am posting the full script as I have no idea where the problem is. If some one could take the time to skim thru my script and find the problem I would be extremely grateful as I have spent hours working on this damn thing.
The main problem is that when I hit enter to go down a line in a forum post it should insert a <br> when adding the post to the database, instead it cuts thru the HTML Still, This shouldn’t happen.
<?php $title = "Forums"; include("header.php"); if ($banned[forums] == 'Yes') { print "You have been banned from the forums, talk to the admin"; include("footer.php"); exit; } $forumsbgc = "#485776;"; ?> <script language="JavaScript" type="text/JavaScript"> function launchForums(){ name=window.open("help.php?help=forums","","width=640,height=480,top=100,left=100,resizable=yes,scrollbars=no,menubar=no,toolbar=no,status=no,location=no") } </script> <script language="JavaScript" type="text/JavaScript"> function sendText(e, text) { e.value += text } </script> <?php // The Topic List if ($view == 'topics') { print "<table><b>Topics</b><br><br>"; $tsel = mysql_query("select * from topics order by id asc"); while ($topic = mysql_fetch_array($tsel)) { $thread_count = mysql_num_rows(mysql_query("select * from threads where in_topic=$topic[id]")); $reply_count = mysql_num_rows(mysql_query("select * from replies where in_topic=$topic[id]")); $post_count = ($reply_count + $thread_count); print "<tr><td><a href=forums.php?threads=$topic[id]>$topic[topic]</a></td></tr>"; print "<tr><td>$topic[info]<br></td></tr>"; print "<tr><td>Threads: $thread_count ---- Total Posts: $post_count<br><br></tr>"; } print "</table>"; if ($stat[rank] == Admin) { print "<center><br><br>[<a href=forums.php?topic=start>Add Topic</a>]</center>"; } } // Threads if ($threads) { print "<table><tr><td width=150><u><b>Topic</td><td width=100><u><b>Starter</td><td width=50><b><u>Replies</td><td><b><u>Last Reply</td></tr>"; $tsel = mysql_query("select * from threads where in_topic=$threads order by last_post_time desc"); while ($thread = mysql_fetch_array($tsel)) { $userinfo = mysql_fetch_array(mysql_query("select * from players where id=$thread[user_id]")); $puser = "$userinfo[user]"; $lastreply = "$thread[last_post_user]"; if ($puser == '0') { $puser = "Deleted"; } if ($lastreply == '0') { $lastreply = "Nobody"; } $replies = mysql_num_rows(mysql_query("select * from replies where thread_id=$thread[id]")); print "<tr><td><a href=forums.php?posts=$thread[id]>$thread[topic]</a></td><td>$puser</td><td>$replies</td><td>$lastreply</td></tr>"; } print "</table>"; print "</center><form method=post action=forums.php?action=addthread&in_topic=$threads>"; print "<center>Add Quick Thread:<br><input type=text name=title2 size=31><br><textarea name=body cols=30 rows=3></textarea><br><input type=submit value=\"Add Topic\"> </form> [<a href=forums.php?action=advthread&in_topic=$threads>Advanced Thread</a>] </center>"; print "<center>[<a href=forums.php?view=topics>Back To Topics</a>]</center>"; if ($stat[rank] == Admin) { print "<br><br><center>[<a href=forums.php?view=deletetopic&id=$threads>Delete Topic</a>][<a href=forums.php?view=cleartopic&id=$threads>Clear Topic</a>]</center>"; } } // View Post if ($posts) { $threadinfo = mysql_fetch_array(mysql_query("select * from threads where id=$posts")); if (empty ($threadinfo['id'])) { print "No such thread."; include("footer.php"); exit; } $userinfo = mysql_fetch_array(mysql_query("select * from players where id=$threadinfo[user_id]")); $puser = "$userinfo[user]"; $posts = "$userinfo[posts]"; $avatar = "$userinfo[avatar]"; if ($puser == '0') { $puser = "Deleted"; } if ($posts == '0') { $posts = "Unknown"; } print " <br> <div align=center> <table border=1 cellpadding=1 bordercolor=$table_border> <tr> <td bgcolor=$forumsbgc rowspan=2 width=20% valign=top><b>$puser</b> <br><b>Posts:</b> $posts <br><br>"; if ($avatar != '') { print "$avatar"; }else{ print "<img src=avatars/none.gif>"; } print "</td> <td bgcolor=$forumsbgc valign=top width=100%><b>Subject:</b> $threadinfo[topic]<br><br></td> </tr> <tr> <td bgcolor=$forumsbgc valign=top height=100 width=340>$threadinfo[body]</td> </tr> <tr> <td bgcolor=$forumsbgc colspan=2 align=center><b>Time Posted:</b>$threadinfo[post_time]</td> </table> </div> <br><br>"; $rsel = mysql_query("select * from replies where thread_id=$threadinfo[id] order by id asc"); while ($reply = mysql_fetch_array($rsel)) { $userinfo = mysql_fetch_array(mysql_query("select * from players where id=$reply[user_id]")); $puser = "$userinfo[user]"; $posts = "$userinfo[posts]"; $avatar = "$userinfo[avatar]"; if ($puser == '0') { $puser = "Deleted"; } if ($posts == '0') { $posts = "Unknown"; } print "<div align=center> <table border=1 bordercolor=$table_border> <tr> <td bgcolor=$forumsbgc rowspan=2 width=20% valign=top><b>$puser</b> <br><b>Posts:</b> $posts <br><br>"; if ($avatar != '') { print "$avatar"; }else{ print "<img src=avatars/none.gif>"; } print " <td bgcolor=$forumsbgc valign=top height=100 width=340>$reply[body]</td> </tr> <tr> <td bgcolor=$forumsbgc colspan=2 align=center><b>Time Posted:</b>$reply[post_time]</td> </table> </div> <br><br>"; } if ($threadinfo[locked] != 'Yes') { print "</center><form method=post action=forums.php?reply=$threadinfo[id]>"; print "<center>Quick Reply:<br><textarea name=rep cols=30 rows=3></textarea><br><input type=submit value=\"Add Reply\"></form> [<a href=forums.php?action=advreply&replyid=$threadinfo[id]>Advanced Reply</a>]</center>"; print "<center>[<a href=forums.php?threads=$threadinfo[in_topic]>Back</a>]</center>"; } else { print "<center>Thread Is Locked!</center>"; if ($stat[rank] == Admin) { print "<center>[<a href=forums.php?view=unlockthread&thread_id=$threadinfo[id]>Un-Lock Thread</a>]</center>"; } print "<center><br>[<a href=forums.php?threads=$threadinfo[in_topic]>Back</a>]</center>"; } if ($stat[rank] == Admin) { print "<center><br><br>[<a href=forums.php?view=deletethread&thread_id=$threadinfo[id]>Delete</a>][<a href=forums.php?view=lockthread&thread_id=$threadinfo[id]>Lock</a>][<a href=forums.php?view=pinthread&thread_id=$threadinfo[id]>Pin</a>]</center>"; } } // Advanced Thread maker if ($action == 'advthread') { ?> <table> <td valign="top">Subject: <p><br>Message: </p> <p> <img name="1" img src="smileys/1.gif" border="0" alt="" onClick="sendText(document.form1.body, ' ')"> <img name="2" img src="smileys/2.gif" border="0" alt="" onClick="sendText(document.form1.body, ' ')"> <img name="3" img src="smileys/3.gif" border="0" alt=":-D" onClick="sendText(document.form1.body, ' :-D ')"> <img name="4" img src="smileys/4.gif" border="0" alt=":-o" onClick="sendText(document.form1.body, ' :-o ')"> <img name="5" img src="smileys/5.gif" border="0" alt=":-P" onClick="sendText(document.form1.body, ' :-P ')"> <img name="6" img src="smileys/6.gif" border="0" alt=";-)" onClick="sendText(document.form1.body, ' ;-) ')"> </p> </p> <?php print "<form name=form1 form method=post action=forums.php?action=addthread&topic=$topic[topic]&in_topic=$in_topic>"; ?> <td><input type=text name=title2 size=30> <br> <img name="7" img src="images/bold.gif" border="0" alt="Bold" onClick="sendText(document.form1.body, '[b] [/b]')"> <img name="7" img src="images/italic.gif" border="0" alt="Italic" onClick="sendText(document.form1.body, '[i] [/i]')"> <img name="7" img src="images/underline.gif" border="0" alt="Underline" onClick="sendText(document.form1.body, '[u] [/u]')"> <img name="7" img src="images/strikethrough.gif" border="0" alt="Strikethrough" onClick="sendText(document.form1.body, '[s] [/s]')"> <textarea name=body cols=60% rows=15></textarea></p> <p><center><input type=submit value="Add Thread"></center> </table> <?php } // Add Thread if ($action == 'addthread') { $date = date("F j Y h:i a"); $c = explode(" ",$body); $body = str_replace("", '<img src="images/smileys/1.gif">',$body); $body = str_replace(":-)", '<img src="images/smileys/1.gif">',$body); $body = str_replace("", '<img src="images/smileys/2.gif">',$body); $body = str_replace(":-(", '<img src="images/smileys/2.gif">',$body); $body = str_replace("", '<img src="images/smileys/3.gif">',$body); $body = str_replace(":-D", '<img src="images/smileys/3.gif">',$body); $body = str_replace("", '<img src="images/smileys/4.gif">',$body); $body = str_replace(":-o", '<img src="images/smileys/4.gif">',$body); $body = str_replace("", '<img src="images/smileys/5.gif">',$body); $body = str_replace("", '<img src="images/smileys/5.gif">',$body); $body = str_replace(":-p", '<img src="images/smileys/5.gif">',$body); $body = str_replace(":-P", '<img src="images/smileys/5.gif">',$body); $body = str_replace("", '<img src="images/smileys/6.gif">',$body); $body = str_replace(";-)", '<img src="images/smileys/6.gif">',$body); $body = str_replace("[b]","<b>",$body); $body = str_replace("[u]","<u>",$body); $body = str_replace("[i]","<i>",$body); $body = str_replace("[s]","<s>",$body); $body = str_replace("[red]","<font style=\"color: FF0000;\">",$body); $body = str_replace("[blue]","<font style=\"color: 0000FF;\">",$body); $body = str_replace("[green]","<font style=\"color: 00FF00;\">",$body); $body = str_replace("[yellow]","<font style=\"color: FFFF00;\">",$body); $body = str_replace("[/red]","</font>",$body); $body = str_replace("[/blue]","</font>",$body); $body = str_replace("[/green]","</font>",$body); $body = str_replace("[/yellow]","</font>",$body); $body = str_replace("[/b]","</b>",$body); $body = str_replace("[/u]","</u>",$body); $body = str_replace("[/i]","</i>",$body); $body = str_replace("[/s]","</s>",$body); $body = nl2br($body); $title2 = str_replace($remove_these, "", "$title2"); $body = str_replace($remove_these, "", "$body"); $title2 = htmlspecialchars($title2); $body = htmlspecialchars($body); if (empty ($title2) || empty ($body)) { print "You must fill all fields."; include("footer.php"); exit; } if ($in_topic == '') { print "Could not add Thread"; }else{ $posts = $stat[posts] + 1; mysql_query("update players set posts='$posts' where id=$stat[id]"); mysql_query("insert into threads (user_id, topic, body, in_topic, post_time, last_post_time) values('$stat[id]', '$title2', '$body</b></u></i></s></font>', '$in_topic', ' $date', '$ctime')") or die("Could not add Thread."); print "<center>Added Thread.<br><br> Back to <a href=forums.php?threads=$in_topic>Threads</a>. <br>Back to <a href=forums.php?view=topics>Topics</a>.</center>"; } } // Advanced Reply thingy if ($action == 'advreply') { ?> <table> <td valign="top"> <p><br><br>Message: <br><br> <img name="1" img src="smileys/1.gif" border="0" alt="" onClick="sendText(document.form1.rep, ' ')"> <img name="2" img src="smileys/2.gif" border="0" alt="" onClick="sendText(document.form1.rep, ' ')"> <img name="3" img src="smileys/3.gif" border="0" alt=":-D" onClick="sendText(document.form1.rep, ' :-D ')"> <br><img name="4" img src="smileys/4.gif" border="0" alt=":-o" onClick="sendText(document.form1.rep, ' :-o ')"> <img name="5" img src="smileys/5.gif" border="0" alt=":-P" onClick="sendText(document.form1.rep, ' :-P ')"> <img name="6" img src="smileys/6.gif" border="0" alt=";-)" onClick="sendText(document.form1.rep, ' ;-) ')"> </p> </p> <?php print "<form name=form1 form method=post action=forums.php?reply=$replyid>"; ?> <td> <img name="7" img src="images/bold.gif" border="0" alt="Bold" onClick="sendText(document.form1.rep, '[b] [/b]')"> <img name="7" img src="images/italic.gif" border="0" alt="Italic" onClick="sendText(document.form1.rep, '[i] [/i]')"> <img name="7" img src="images/underline.gif" border="0" alt="Underline" onClick="sendText(document.form1.rep, '[u] [/u]')"> <img name="7" img src="images/strikethrough.gif" border="0" alt="Strikethrough" onClick="sendText(document.form1.rep, '[s] [/s]')"> <textarea name=rep cols=60% rows=15></textarea></p> <p><center><input type=submit value="Add Post"></center> </table> <?php } // Add Reply if ($reply) { $date = date("F j Y h:i a"); $threadinfo = mysql_fetch_array(mysql_query("select * from threads where id=$reply")); $exists = mysql_num_rows(mysql_query("select * from threads where id=$reply")); if ($threadinfo[locked] == 'Yes') { print "Thread Is Locked!"; } else { $rep = str_replace($remove_these, "", "$rep"); $rep = htmlspecialchars($rep); $rep = nl2br($rep); $smileys = array( '' => '1.gif', ':-)' => '1.gif', '' => '2.gif', ':-(' => '2.gif', '' => '3.gif', ':-D' => '3.gif', '' => '4.gif', ':-o' => '4.gif', '' => '5.gif', '' => '5.gif', ':-p' => '5.gif', ':-P' => '5.gif', '' => '6.gif', ';-)' => '6.gif'); foreach($smileys as $smiley=>$image) { $rep = str_replace($smiley, '<img src="smileys/'.$image.'">',$rep); } $c = explode(" ",$rep); $rep = str_replace("[b]","<b>",$rep); $rep = str_replace("[u]","<u>",$rep); $rep = str_replace("[i]","<i>",$rep); $rep = str_replace("[s]","<s>",$rep); $rep = str_replace("[red]","<font style=\"color: FF0000;\">",$rep); $rep = str_replace("[blue]","<font style=\"color: 0000FF;\">",$rep); $rep = str_replace("[green]","<font style=\"color: 00FF00;\">",$rep); $rep = str_replace("[yellow]","<font style=\"color: FFFF00;\">",$rep); $rep = str_replace("[/red]","</font>",$rep); $rep = str_replace("[/blue]","</font>",$rep); $rep = str_replace("[/green]","</font>",$rep); $rep = str_replace("[/yellow]","</font>",$rep); $rep = str_replace("[/b]","</b>",$rep); $rep = str_replace("[/u]","</u>",$rep); $rep = str_replace("[/i]","</i>",$rep); $rep = str_replace("[/s]","</s>",$rep); if ($exists <= 0) { print "No such topic."; include("footer.php"); exit; } if (empty ($rep)) { print "You must fill out all fields."; include("footer.php"); exit; } $posts = $stat[posts] + 1; mysql_query("update players set posts='$posts' where id=$stat[id]"); mysql_query("update threads set last_post_time='$ctime' where id='$reply'"); mysql_query("update threads set last_post_user='$stat[user]' where id='$reply'"); mysql_query("insert into replies (user_id, thread_id, body, post_time, in_topic) values('$stat[id]', '$reply', '$rep</b></u></i></s></font>', ' $date', '$threadinfo[in_topic]')") or die("Could not add reply."); print "<center>Reply added.<br><br> Back to <a href=forums.php?posts=$reply>Post</a>. <br>Back to <a href=forums.php?threads=$threadinfo[in_topic]>Threads</a>.</center>"; } } //Topic Maker if ($topic == 'start') { if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } ?> <table> <td valign="top">Topic: <p><br>Info: <?php print "<form name=form1 form method=post action=forums.php?topic=addtopic>"; ?> <td><input type=text name=topic_name size=30> <br> <img name="7" img src="images/bold.gif" border="0" alt="Bold" onClick="sendText(document.form1.topic_info, '[b] [/b]')"> <img name="7" img src="images/italic.gif" border="0" alt="Italic" onClick="sendText(document.form1.topic_info, '[i] [/i]')"> <img name="7" img src="images/underline.gif" border="0" alt="Underline" onClick="sendText(document.form1.topic_info, '[u] [/u]')"> <img name="7" img src="images/strikethrough.gif" border="0" alt="Strikethrough" onClick="sendText(document.form1.topic_info, '[s] [/s]')"> <textarea name=topic_info cols=80% rows=15></textarea></p> <p><center><input type=submit value="Add Topic"></center> </table> <?php } //Add Topic if ($topic == 'addtopic') { if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } $topic_name = str_replace($remove_these, "", "$topic_name"); $topic_info = str_replace($remove_these, "", "$topic_info"); $topic_name = htmlspecialchars($topic_name); $topic_info = htmlspecialchars($topic_info); $c = explode(" ",$topic_name); $topic_info = str_replace("[b]","<b>",$topic_info); $topic_info = str_replace("[u]","<u>",$topic_info); $topic_info = str_replace("[i]","<i>",$topic_info); $topic_info = str_replace("[s]","<s>",$topic_info); $topic_info = str_replace("[/b]","</b>",$topic_info); $topic_info = str_replace("[/u]","</u>",$topic_info); $topic_info = str_replace("[/i]","</i>",$topic_info); $topic_info = str_replace("[/s]","</s>",$topic_info); if (empty ($topic_name) || empty ($topic_info)) { print "You must fill out all fields."; include("footer.php"); exit; } mysql_query("insert into topics (topic, info) values('$topic_name</b></u></i></s>', '$topic_info</b></u></i></s>')") or die("Could not add reply."); print "<center>Topic added.<br><br> <br>Back to <a href=forums.php?view=topics>Threads</a>.</center>"; } //Remove Topic if ($view == 'deletetopic') { $topic = mysql_fetch_array(mysql_query("select * from topics where id=$id")); if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } if (empty ($topic[id])) { print "No such Topic."; include("footer.php"); exit; } mysql_query("delete from replies where thread_id=$id"); mysql_query("delete from threads where in_topic=$id"); mysql_query("delete from topics where id=$id"); print "<center>Topic Deleted<br><br> Back to <a href=forums.php?view=topics>Topics</a>.</center> "; } // Clear Topic if ($view == 'cleartopic') { $topic = mysql_fetch_array(mysql_query("select * from topics where id=$id")); if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } if (empty ($topic[id])) { print "No such Topic."; include("footer.php"); exit; } mysql_query("delete from replies where topic=$id"); mysql_query("delete from threads where in_topic=$id"); print "<center>Topic Cleared<br><br> Back to <a href=forums.php?threads=$id>Threads</a>. <br>Back to <a href=forums.php?view=topics>Topics</a>.</center> "; } //Remove Thread if ($view == 'deletethread') { $thread = mysql_fetch_array(mysql_query("select * from threads where id=$thread_id")); if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } if (empty ($thread[id])) { print "No such Thread."; include("footer.php"); exit; } mysql_query("delete from replies where thread_id=$thread[id]"); mysql_query("delete from threads where id=$thread[id]"); print "<center>Thread Deleted<br><br> Back to <a href=forums.php?threads=$thread[in_topic]>Threads</a>. <br>Back to <a href=forums.php?view=topics>Topics</a>.</center> "; } //Lock Thread if ($view == 'lockthread') { $thread = mysql_fetch_array(mysql_query("select * from threads where id=$thread_id")); if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } if (empty ($thread[id])) { print "No such Thread."; include("footer.php"); exit; } mysql_query("update threads set locked='Yes' where id=$thread[id]"); print "<center>The thread has been Locked<br><br> Back to <a href=forums.php?posts=$thread[id]>Post</a>. <br>Back to <a href=forums.php?threads=$thread[in_topic]>Threads</a>.</center> "; } //Un-Lock Thread if ($view == 'unlockthread') { $thread = mysql_fetch_array(mysql_query("select * from threads where id=$thread_id")); if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } if (empty ($thread[id])) { print "No such Thread."; include("footer.php"); exit; } mysql_query("update threads set locked='No' where id=$thread[id]"); print "<center>The thread has been Un-Locked<br><br> Back to <a href=forums.php?posts=$thread[id]>Post</a>. <br>Back to <a href=forums.php?threads=$thread[in_topic]>Threads</a>.</center> "; } //Pin Thread if ($view == 'pinthread') { $thread = mysql_fetch_array(mysql_query("select * from threads where id=$thread_id")); if ($stat[rank] != Admin) { print "You're not an admin."; include("footer.php"); exit; } if (empty ($thread[id])) { print "No such Thread."; include("footer.php"); exit; } mysql_query("update threads set last_post_time='9999999999' where id=$thread[id]"); print "<center>The Thread has been Pinned<br><br> Back to <a href=forums.php?posts=$thread[id]>Post</a>. <br>Back to <a href=forums.php?threads=$thread[in_topic]>Threads</a>.</center> "; } ?> <center>[<a href="javascript:launchForums()">Help</a>]</center> <?php include("footer.php"); ?>
-
My sites mailing sysytem works thinke this.
When a player sends a mail it inserts it into the mail table in my data base, the players then get to see the mails where the owner is = to there ID.
The owners ID is the ID that a player sends the message to.
How in PHP would i make a function for Admins to send a mail to every id in the game?
-
Script Explantion..
When Some one cheats i add there isp details into a table called badisp, in a feild called isp.
Im prety sure i used the right sql string to access that table.
The script should display that message if any of the entries match that person ISP.
-
Still doesnt work..
<?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); $stat = mysql_fetch_array(mysql_query("select * from players where user='$user' and pass='$pass'")); mysql_query("update players set hostname='{$hostname}' where id={$stat['id']}"); $badisp = mysql_fetch_array(mysql_query("select * from badisp")); if ($hostname == $badisp['isp']){ print "Invalid login MOFO."; } ?>
-
can anyone tell me why this dosnt work?
<?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); mysql_query("update players set hostname=$hostname where id=$stat[id]"); $badisp = mysql_fetch_array(mysql_query("select * from badisp")); if ($hostname == $badisp[isp]){ print "Invalid login MOFO."; } ?>/code]
-
Can anyone see whats wrong with this? It returns an error..
if ($view == isp) { print "<form method=post action=admin.php?view=isp&step=isp>ID: <input type=text name=id> <input type=submit value=BLOCK ISP></form>"; if ($step == isp) { $user = mysql_fetch_array(mysql_query("select * from players where id='$id'")); $isp = $user[isp] $sql = "INSERT INTO badisp ( id, isp ) "; $sql .= "VALUES ('".$id."', '".$isp."' )"; $sql .= ""; mysql_query("$sql"); print "You have blocked Player <b>$id 's</b> ISP<br><br>ISP: <b>$isp</b>"; } }
-
I have it set up so that people ISP's are recorded in the database on every page they visit.
Im going to create a bad ISP list for everyone who i want to block.
Whats the string for selecting an entire table and its enteries?
then id simply do
if ($isp == $badisptable){
Print "Go home!";
}
-
He just being a total **** and spamming everyone.
Just generaly causing hastle to other players and making the game less fun for everyone.
-
I tested it out on an admin and it returned there IP adress.
<?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); echo $hostname; ?>
-
There is some one causing allot of problems for me on my PHP game. I have used in game means to punish him and he simply deleted and remakes an account, all security measures in place don’t stop this as he uses a proxy server.
How would I block his ISP? As far as Im aware that would stop the problem until he got on at another computer.
I have no ways or tracking his ISP tho, only his IP so far.
Please can some one help ASAP as hes ruining my game for everyone!!
$name = IFSTRING
in PHP Coding Help
Posted
I need the IF statment inside the $variable.
so that when ever i use $keycheck the same if statement is repeated.