Jump to content

pojr

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by pojr

  1. I add added it in in it's own. I'm still uncertain on how to perform this.
  2. Sorry, but it doesn't work. I should say that the database bannedwords has a few banned words in there; it's not a single banned word.
  3. I don't know how to pass the banned word.
  4. Sorry, my computer was about to die (and it's about to again) so I couldn't. But now I have it. <?php Session_Start(); mysql_connect("localhost", "dan92_happy", "[CENSORED]") or die(mysql_error()); mysql_select_db("dan92_admin") or die(mysql_error()); $resultsagain = mysql_query("SELECT * FROM bannedwords") or die(mysql_error()); while($chaos = mysql_fetch_array( $resultsagain )) { $ban = $chaos['wrd']; $num_rows = mysql_num_rows($resultsagain); } /* ... continued ... */ } elseif(!(strpos($pst, "$num_rows" ) == true)) { echo "Error! $ban is a banned word."; ?>
  5. <?php Session_Start(); mysql_connect("localhost", "dan92_happy", "[CENSORED]") or die(mysql_error()); mysql_select_db("dan92_admin") or die(mysql_error()); $resultsagain = mysql_query("SELECT * FROM bannedwords") or die(mysql_error()); while($chaos = mysql_fetch_array( $resultsagain )) { $ban = $chaos['wrd']; $num_rows = mysql_num_rows($resultsagain); } $resultagain = mysql_query("SELECT * FROM user WHERE nm='$_SESSION[username]'") or die(mysql_error()); while($rao = mysql_fetch_array( $resultagain )) { $sk = $rao['sk']; if ( $sk == '1' ) { include("..//head.php"); echo "<title>Forums - Chankys</title>"; include("..//headunder.php"); include("..//menu.php"); } elseif ( $sk == '2') { include("..//head2.php"); echo "<title>Forums - Chankys</title>"; include("..//headunder.php"); include("..//menu2.php"); } else { include("..//head.php"); echo "<title>Forums - Chankys</title>"; include("..//headunder.php"); include("..//menu.php"); } } if ( $_SESSION[logged_in] == 0 ) { include("..//head.php"); echo "<title>Forums - Chankys</title>"; include("..//headunder.php"); include("..//menu.php"); } $av = $_SESSION[av]; $nm = $_POST['nm']; $pst = $_POST['pst']; $tt = $_POST['tt']; $tid = $_POST['tid']; $ip = $_SERVER['REMOTE_ADDR']; $lk = $_POST['lk']; $id = $_POST['id']; $dt = date("l, F j, Y h:i:s A"); $pst = preg_replace("/\n/","\n<br />",$pst); $nm = stripslashes($nm); $bid = stripslashes($bid); $nm = strip_tags($nm); if($_SESSION[user] == administrator ) { $pst = strip_tags($pst, '<b><i><u><br><img><a><table><td><tr><th><frame>'); $tt = strip_tags($tt, '<b><i><u>'); } else { $pst = strip_tags($pst, '<b><i><u><br>'); $tt = strip_tags($tt); } $bid = strip_tags($bid); $nm = $_SESSION[username]; $lk = "http://dan92.yfma.com/u.php?id=$_SESSION[id]"; $bid = $_GET['f']; if ( $bid == "" ) { $quero = "SELECT * FROM forum WHERE id='$tid'"; $result = mysql_query($quero) or die(mysql_error()); $list = mysql_fetch_array($result) or die(mysql_error()); $num_rows = mysql_num_rows($result); $lock = $list['cs']; } else { $queris = "SELECT * FROM board WHERE id='$bid'"; $results = mysql_query($queris) or die(mysql_error()); $row = mysql_fetch_array($results) or die(mysql_error()); $lv = $row['lv']; $des = $row['des']; } if( $lv == '2' ) { if($_SESSION[user] == administrator ) { echo ""; } elseif($_SESSION[user] == 'trusted member' ) { echo ""; } else { $access = "negative"; } } elseif($lv == '3' ) { if($_SESSION[user] == administrator ) { $access = "positive"; } elseif($_SESSION[user] == 'trusted member' ) { $access = "positive"; } else { $access = "notpositive"; } } else { ""; } if (!(strpos($pst, "<b>" ) == true)) { if (!(strpos($pst, "</b>" ) == false)) { $htmlallowance = "negative"; } } if (!(strpos($pst, "<i>" ) == true)) { if (!(strpos($pst, "</i>" ) == false)) { $htmlallowance = "negative"; } } if (!(strpos($pst, "<u>" ) == true)) { if (!(strpos($pst, "</u>" ) == false)) { $htmlallowance = "negative"; } } if($_SESSION[logged_in] == 0 ) { echo "<h1>Access error!</h1><p>You need an account at Chanky's. register one <a href=\"..//register.php\"><b>here</b></a>.</p>"; } elseif($_SESSION[user] == 'banned member' ) { echo "<h1>Access error!</h1><p>You can no longer post at Chanky's because of your user level."; } elseif($_SESSION[user] == 'suspended member' ) { echo "<h1>Access error!</h1><p>You temporarily cannot post at Chanky's because of your user level. Wait for your condemn results for further notice."; } elseif($htmlallowance == "negative" ) { echo "<h1>Error!</h1><p>Your post has bad HTML. You failed to end the bold tag.</p>"; } elseif($pst == "" ) { echo "<h1>Error!</h1> <p>Your post is black. Please change that! You need at least one character.</p>"; } elseif(!(strpos($pst, "$num_rows" ) == true)) { echo "Error! $ban is a banned word."; } elseif($pst == "<b></b>" ) { echo "<h1>Error!</h1> <p>Your post is black. Please change that! You need at least one character.</p>"; } elseif($pst == "<i></i>" ) { echo "<h1>Error!</h1> <p>Your post is black. Please change that! You need at least one character.</p>"; } elseif($pst == "<u></u>" ) { echo "<h1>Error!</h1> <p>Your post is black. Please change that! You need at least one character.</p>"; } elseif($access == "negative" ) { echo "<h1>Access Error!</h1><p>You cannot post in this forum. Only trusted members and administrators can.</p>"; } elseif($lock == "lock" ) { echo "<h1>Access error!</h1><p>This topic is locked! You cannot post in this topic. If you insist on posting in this topic, then unlock it.</p>"; } elseif($lock == "pinlock" ) { echo "<h1>Access error!</h1><p>This topic is locked! Even though this topic is pinned, it does not mean you can post in it. You cannot post in this topic. If you insist on posting in this topic, then unlock it.</p>"; } elseif($ip == '71.101.45.67' ) { /* $resultend = mysql_query("UPDATE user SET user='suspended member' WHERE nm='$nm'") $resultend = mysql_query("UPDATE user SET age='User committed Terms of Agreement violations, but punishment is pending. The user may or may not end up getting banned.' WHERE nm='$nm'") or die(mysql_error()); */ echo "<h1>Congratulations!</h1><p>You have successfully went through the posting system! However, rather then posting the message, the staff at Chanky's have decided to suspend your account."; session_destroy(); } elseif($bid == "" ) { if($num_rows == 1) { mysql_query("INSERT INTO forum (nm, brd, pst, tid, ip, tt, id, lk, dt, av) VALUES('$nm', '$bid', '$pst', '$tid', '$ip', '$tt', '$id', '$lk', '$dt', '$_SESSION[av]' ) ") or die(mysql_error()); echo "<h1>Congrats!</h1><p>Your message was submitted! View your post <a href=\"t.php?id=$tid\"><b>right here</b></a>. Make sure that your post follows the <a href=\"http://www.dan92.yfma.com/terms.php\"><b>Terms of Agreement</b></a>.</p>"; } else { echo "<h1>Flood control enabled!</h1> <p>You made this post about a second after another one! cut down!</p>"; } } elseif($_SESSION[user] == 'POW member' ) { echo "<h1>Access error!</h1><p>You cannot make topic on Chanky's as your user level. POW members can make messages, but cannot start topics."; } elseif($tt == "" ) { echo "<h1>Error!</h1> <p>Your topic title is non-existent. Please change that! You need at least one character.</p>"; } elseif($access == "notpositive" ) { echo "<h1>Access error!</h1> <p>Only trusted members and administrators can post topics on this forum. You do not sport a high enough user level to post topics on this forum, but you can make posts.</p>"; } elseif($des == "" ) { echo "<h1>Whoa whoa whoa!</h1><p>You can't post a topic on a forum that doesn't even exist!"; } else { mysql_query("INSERT INTO forum (nm, brd, pst, tid, ip, tt, id, lk, dt, av) VALUES('$nm', '$bid', '$pst', '$tid', '$ip', '$tt', '$id', '$lk', '$dt', '$_SESSION[av]' ) ") or die(mysql_error()); echo "<h1>Congrats!</h1><p>Your topic was submitted! View your topic <a href=\"f.php?id=$bid\"><b>right here</b></a>. Make sure that your post follows the <a href=\"http://www.dan92.yfma.com/terms.php\"><b>Terms of Agreement</b></a>.</p>"; } include("..//foot.php"); ?> $PST is the post, and I don't know why this won't work. Any help appreciated.
  6. Oh wait, I just figured it out. Thanks though. http://forums.dan92.yfma.com/ should work now.
  7. Sounds good, but this script is not working. <?php if (!(strpos($pst, "<b>" ) === true)) { if (!(strpos($pst, "</b>" ) === false)) { $htmlallowance = "negative"; } } ?> The post in my forums still go through then I don't add a </b> when posting <b>.
  8. From testing, quotes only seem to matter if there is a space in the word. Yeah however, that was what I was looking for. Thanks.
  9. For if statements, well lets say my post content is under $post, and I don't want this content to have any curse words. If I were to do: if ( $post == gris ) { echo "<h1>Error!</h1> Gris is a naughty word. I cannot let you say that on this site!"; It would vary. If I posted just gris on the post line, I would get the error message, but posted I like gris, the post would go through. I know the if == is sharp, so is there a way for $post to register one word in the post? Thanks a bunch in return.
  10. I think it has to do with the format you have. Try echo "Stuff"; rather then echo 'stuff';.
  11. Not an IP address. but ISP. I searched Google first, and found nothing on it. I plan to use it to ban some people from my site. One user specifically keeps making an account on a proxy, even after me banning his IP, so now I might try banning his ISP. Anyone know? Thanks.
  12. In message boards, after a certain amount of messages, the page continues to a different page. However for me, the messages just keep pouring and pouring. How is this done? http://www.dan92.yfma.com/forums/t.php?id=32
  13. Wow; you're my hero. I had to change a few things around to make it function, and make it custom, so it works perfectly.
  14. I just gave a login script a shot. It failed. Why did it? Here's the script: mysql_connect("localhost", "dan92_happy", "XXXXXXXXXXXX") or die(mysql_error()); mysql_select_db("dan92_admin") or die(mysql_error()); $name = $_POST['username']; $pass = $_POST['password']; $namepass = "$name $password"; $results = mysql_query("SELECT * FROM user WHERE nm='$name' ORDER BY id") or die(mysql_error()); $id = $_POST['id']; while($row = mysql_fetch_array( $results )) { echo "Attempting to log onto "; echo $row['nm']; echo "..."; $nm = $row['nm']; $pw = $row['pwl']; } $nmpw = "$nm $pw"; if ( $namepass == $nmpw ) { echo "<h1>Success!</h1> <p>You have logged into your account. Now you can post on the forums.</p>"; $usr = intval($_COOKIE['usr']); setcookie('usr', $usr = $nm, strtotime('+30 days')); } else { echo "<h1>Failure!</h1> <p>You were unsuccessful in logging in. Please try again.</p>"; } ?> You can try making an account, and logging in to http://www.dan92.yfma.com/forums/ (The form is way down at the bottom), but even with the correct password and user name input, the login always results failure. 'login.php' uses the code I had just place on this message.
  15. I do. Hang on, let me update the site. I accidentally moved some file around.
  16. Okay, I own http://www.dan92.yfma.com/ (supposed to be Chankys.com, but someone stole my domain name the day I tried to register; it was apparently a friend from another site). Everything on there so far is going pretty good, but now, I am in a pickle. I don't know how to login to accounts, and if I ever were to, I wouldn't know how to stay logged in. Could someone give me a hand?
×
×
  • 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.