Jump to content

3raser

Members
  • Posts

    815
  • Joined

  • Last visited

Everything posted by 3raser

  1. Alright, I know how to make sessions. But, I want to make a session that allows me to stop users from voting for a site for another 1 hour and then the session goes away. How would I be able to do that?
  2. The variables are working. And here is my error; Warning: fsockopen() [function.fsockopen]: unable to connect to hey:43594 (Connection refused) in /home/a9726309/public_html/index.php on line 16
  3. Does anyone on this freaking forum know?!
  4. I have to go soon....
  5. http://runelocus.com/status/ - Here are some statuses of online servers Try and input one of them here: http://webmasters.webatu.com/index.php Why does it keep saying offline? Code: <form action='index.php' method='GET'>Server IP: <input type='text' name='server' /> Server port: (Default is 43594)<input type='text' name='port' value='43594'/><input type='submit' value='Register my status!'></form> <?php $server = $_GET['server']; $port = $_GET['port']; if (!$server || !$port) { die(""); } error_reporting(0); $checkport = fsockopen($server, $port, $errnum, $errstr, 2); if(!$checkport) { die('<img src="offline.png" />'); } //ErrorHandel else { $my_img = imagecreatefrompng ( "online.png" ); $background = imagecolorallocate( $my_img, 111, 111, 111 ); $text_colour = imagecolorallocate( $my_img, 222, 222, 222 ); imagestring( $my_img, 5, 55, 68, $site, $text_colour ); imagesetthickness ( $my_img, 5 ); header( "Content-type: image/png" ); imagepng( $my_img ); imagecolordeallocate( $text_color ); imagecolordeallocate( $background ); imagedestroy( $my_img ); fclose($fp); } ?>
  6. Where would I make it md5?
  7. How do I make it so when someone registers, it saves their password but in a way you can't see their password. Currently if you register on my site with the password: hey - It shows in the database: hey - I want it to be like this: hey = 558541 I've seen it before on like vBulletin scripts and phpBB3, how do you do it?
  8. $_SESSION['id'] should be ['username'], I've changed that. And I thought owner was some command. - It's suppose to be name.
  9. I've added that, but it doesn't even delete the posts. http://www.commentbb.com/demo/ Code <?php require "global_navigation.php"; ?> <?php if ($_SESSION['username']) { echo ' <a href="logout.php"><img src="images/logout.png"></img></a> <a href="member_list.php"><img src="images/members.png"</a> <a href="search_input.php"><img src="images/search.png"></a> <a href="profiles.php"><img src="images/profile.png"></a> <a href="ucp.php"><img src="images/UCP.png"></a></b> <a href="acp.php"><img src="images/acp.png"></a> <a href="modcp.php"><img src="images/modcp.png"></a>'; } else { echo '<a href="register.php"><img src="images/register.png"></img></a> <a href="login.php"><img src="images/log-in.png"></img></a> <a href="search_input.php"><img src="images/search.png"></a> <a href="profiles.php"><img src="images/profile.png"></a>'; echo "<br />"; echo $gmessage; } ?> <br /> <?php //connecting to the database $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); $delete = $_GET['id']; $usernamesession = $_SESSION['username']; $filename = 'install.php'; if (!$delete) { } else { mysql_query("DELETE FROM posts WHERE id='$delete' AND owner='".$_SESSION['id']."'"); } if (file_exists($filename)) { echo "<div class='box'>If you haven't yet installed commentBB, do so here: <a href='install.php'><b>Install</b></a> - If you already have, then delete install.php and/or installed.php for MAJOR security reasons!</div>"; } else { if ($_SESSION['username']) { echo "<br />Logged in as <b> ".$_SESSION['username']."</b>!<br />"; } else exit ?> <?php ?> <?php if ($disabled==0) { echo '<form action="post.php" method="POST"> Message <br><br><textarea name="message" rows="10" cols="100"> </textarea><br> <input type="submit" value="Post it!"> </form></center></span><hr> <br>'; } else { echo "<div class='box'>Posting disabled!</div>"; } //max displayed per page $per_page = 8; //get start variable $start = $_GET['start']; //count records $record_count = mysql_num_rows(mysql_query("SELECT * FROM posts")); //count max pages $max_pages = $record_count / $per_page; //may come out as decimal if (!$start) $start = 0; //staff CHECK $get2 = mysql_query("SELECT * FROM users WHERE username='$name'"); while ($row2 = mysql_fetch_assoc($get2)) { // get data $staffcheck = $row2['staff']; } //display data $get = mysql_query("SELECT * FROM posts ORDER BY id DESC LIMIT $start, $per_page"); while ($row = mysql_fetch_assoc($get)) { // get data $id = $row['id']; $name = $row['name']; $message = $row['message']; if ($staffcheck ==2) { $name = " <img src='$acrown'></img><b> $owner</b></a>"; } //smileys $before = array('', '', '', ''); $after = array('<img src="smileys/happy.png">', '<img src="smileys/sad.png">', '<img src="smileys/wide.png">', '<img src="smileys/tounge.png">'); $output = str_replace($before, $after, $message); if ($name=="$usernamesession") { $name = "<a href='index.php?id=$id'><span style='color:red'>X</span></a> $name"; } echo "<center><b><a href='report.php?id=$id'><img src='images/report.png' alt='Report'></img></a> ($id)Posted by:</b> ".$name."</a><br /><b>".$output."<hr></b>"; } //setup prev and next variables $prev = $start - $per_page; $next = $start + $per_page; //show prev button if (!($start<=0)) echo "<a href='index.php?start=$prev'>Prev</a> "; //show page numbers //set variable for first page $i=1; for ($x=0;$x<$record_count;$x=$x+$per_page) { if ($start!=$x) echo " <a href='index.php?start=$x'>$i</a> "; else echo " <a href='index.php?start=$x'><b>$i</b></a> "; $i++; } //show next button if (!($start>=$record_count-$per_page)) echo " <a href='index.php?start=$next'>Next</a>"; } //prosses of getting the numbers $construct = "SELECT * FROM posts"; $run = mysql_query($construct); $foundnum = (mysql_num_rows($run)); //prosses of getting the numbers for users $construct2 = "SELECT * FROM users"; $run2 = mysql_query($construct2); $foundnum2 = (mysql_num_rows($run2)); echo "<br /><br />Total comments: "; echo $foundnum; echo " ||"; echo " Total members: "; echo $foundnum2; ?> </font></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </center> <table class="tborder" cellpadding="4" cellspacing="1" width="67%"> <tbody> <tr> <td class="thead"><font face="Trebuchet MS"><strong> Copyright</strong></font></td> </tr> <tr> <td class="trow1"> <table border="0" cellpadding="4" width="100%"> <tbody> <tr> <td class="trow1"> <p align="center"> <span class="smalltext" style="display: inline; visibility: visible; font-family: Trebuchet MS; font-weight: 700"> <a title="Simple Machines Forum" target="_blank" class="new_win" href="http://commentbb.com"> <font size="2">Powered by CommentBB 1.0 BETA</font></a><font size="2"> | </font><a href="http://commentbb.com"><font size="2">CBB is © 2009, CommentBB INC</font></a></span></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </div> <font face="Trebuchet MS"> <!-- end: footer --> <!-- end: portal --></font></body></html>
  10. Doesn't seem to be working for me. <?php require "global_navigation.php"; ?> <?php if ($_SESSION['username']) { echo ' <a href="logout.php"><img src="images/logout.png"></img></a> <a href="member_list.php"><img src="images/members.png"</a> <a href="search_input.php"><img src="images/search.png"></a> <a href="profiles.php"><img src="images/profile.png"></a> <a href="ucp.php"><img src="images/UCP.png"></a></b> <a href="acp.php"><img src="images/acp.png"></a> <a href="modcp.php"><img src="images/modcp.png"></a>'; } else { echo '<a href="register.php"><img src="images/register.png"></img></a> <a href="login.php"><img src="images/log-in.png"></img></a> <a href="search_input.php"><img src="images/search.png"></a> <a href="profiles.php"><img src="images/profile.png"></a>'; echo "<br />"; echo $gmessage; } ?> <br /> <?php //connecting to the database $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); $delete = $_GET['id']; $usernamesession = $_SESSION['username']; $filename = 'install.php'; if($_SESSION['username'] == $_GET['id']){ mysql_query("DELETE FROM posts WHERE id='$delete'"); } if (file_exists($filename)) { echo "<div class='box'>If you haven't yet installed commentBB, do so here: <a href='install.php'><b>Install</b></a> - If you already have, then delete install.php and/or installed.php for MAJOR security reasons!</div>"; } else { if ($_SESSION['username']) { echo "<br />Logged in as <b> ".$_SESSION['username']."</b>!<br />"; } else exit ?> <?php ?> <?php if ($disabled==0) { echo '<form action="post.php" method="POST"> Message <br><br><textarea name="message" rows="10" cols="100"> </textarea><br> <input type="submit" value="Post it!"> </form></center></span><hr> <br>'; } else { echo "<div class='box'>Posting disabled!</div>"; } //max displayed per page $per_page = 8; //get start variable $start = $_GET['start']; //count records $record_count = mysql_num_rows(mysql_query("SELECT * FROM posts")); //count max pages $max_pages = $record_count / $per_page; //may come out as decimal if (!$start) $start = 0; //staff CHECK $get2 = mysql_query("SELECT * FROM users WHERE username='$name'"); while ($row2 = mysql_fetch_assoc($get2)) { // get data $staffcheck = $row2['staff']; } //display data $get = mysql_query("SELECT * FROM posts ORDER BY id DESC LIMIT $start, $per_page"); while ($row = mysql_fetch_assoc($get)) { // get data $id = $row['id']; $name = $row['name']; $message = $row['message']; if ($staffcheck ==2) { $name = " <img src='$acrown'></img><b> $owner</b></a>"; } //smileys $before = array('', '', '', ''); $after = array('<img src="smileys/happy.png">', '<img src="smileys/sad.png">', '<img src="smileys/wide.png">', '<img src="smileys/tounge.png">'); $output = str_replace($before, $after, $message); if ($name=="$usernamesession") { $name = "<a href='index.php?id=$id'><span style='color:red'>X</span></a> $name"; } echo "<center><b><a href='report.php?id=$id'><img src='images/report.png' alt='Report'></img></a> ($id)Posted by:</b> ".$name."</a><br /><b>".$output."<hr></b>"; } //setup prev and next variables $prev = $start - $per_page; $next = $start + $per_page; //show prev button if (!($start<=0)) echo "<a href='index.php?start=$prev'>Prev</a> "; //show page numbers //set variable for first page $i=1; for ($x=0;$x<$record_count;$x=$x+$per_page) { if ($start!=$x) echo " <a href='index.php?start=$x'>$i</a> "; else echo " <a href='index.php?start=$x'><b>$i</b></a> "; $i++; } //show next button if (!($start>=$record_count-$per_page)) echo " <a href='index.php?start=$next'>Next</a>"; } //prosses of getting the numbers $construct = "SELECT * FROM posts"; $run = mysql_query($construct); $foundnum = (mysql_num_rows($run)); //prosses of getting the numbers for users $construct2 = "SELECT * FROM users"; $run2 = mysql_query($construct2); $foundnum2 = (mysql_num_rows($run2)); echo "<br /><br />Total comments: "; echo $foundnum; echo " ||"; echo " Total members: "; echo $foundnum2; ?> </font></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </center> <table class="tborder" cellpadding="4" cellspacing="1" width="67%"> <tbody> <tr> <td class="thead"><font face="Trebuchet MS"><strong> Copyright</strong></font></td> </tr> <tr> <td class="trow1"> <table border="0" cellpadding="4" width="100%"> <tbody> <tr> <td class="trow1"> <p align="center"> <span class="smalltext" style="display: inline; visibility: visible; font-family: Trebuchet MS; font-weight: 700"> <a title="Simple Machines Forum" target="_blank" class="new_win" href="http://commentbb.com"> <font size="2">Powered by CommentBB 1.0 BETA</font></a><font size="2"> | </font><a href="http://commentbb.com"><font size="2">CBB is © 2009, CommentBB INC</font></a></span></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </div> <font face="Trebuchet MS"> <!-- end: footer --> <!-- end: portal --></font></body></html>
  11. When ever they click the red X on index.php, it deletes their posts and the X only shows up on their own posts. But when they enter index.php?id=50 in their address bar, it deletes post ID 50 even if it's not their own post. How do I stop this from happening? <?php require "global_navigation.php"; ?> <?php if ($_SESSION['username']) { echo ' <a href="logout.php"><img src="images/logout.png"></img></a> <a href="member_list.php"><img src="images/members.png"</a> <a href="search_input.php"><img src="images/search.png"></a> <a href="profiles.php"><img src="images/profile.png"></a> <a href="ucp.php"><img src="images/UCP.png"></a></b> <a href="acp.php"><img src="images/acp.png"></a> <a href="modcp.php"><img src="images/modcp.png"></a>'; } else { echo '<a href="register.php"><img src="images/register.png"></img></a> <a href="login.php"><img src="images/log-in.png"></img></a> <a href="search_input.php"><img src="images/search.png"></a> <a href="profiles.php"><img src="images/profile.png"></a>'; echo "<br />"; echo $gmessage; } ?> <br /> <?php //connecting to the database $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); $delete = $_GET['id']; $usernamesession = $_SESSION['username']; $filename = 'install.php'; if (!$delete) { } else { //delete mysql_query("DELETE FROM posts WHERE id=''") or die(mysql_error()); } if (file_exists($filename)) { echo "<div class='box'>If you haven't yet installed commentBB, do so here: <a href='install.php'><b>Install</b></a> - If you already have, then delete install.php and/or installed.php for MAJOR security reasons!</div>"; } else { if ($_SESSION['username']) { echo "<br />Logged in as <b> ".$_SESSION['username']."</b>!<br />"; } else exit ?> <?php ?> <?php if ($disabled==0) { echo '<form action="post.php" method="POST"> Message <br><br><textarea name="message" rows="10" cols="100"> </textarea><br> <input type="submit" value="Post it!"> </form></center></span><hr> <br>'; } else { echo "<div class='box'>Posting disabled!</div>"; } //max displayed per page $per_page = 8; //get start variable $start = $_GET['start']; //count records $record_count = mysql_num_rows(mysql_query("SELECT * FROM posts")); //count max pages $max_pages = $record_count / $per_page; //may come out as decimal if (!$start) $start = 0; //staff CHECK $get2 = mysql_query("SELECT * FROM users WHERE username='$name'"); while ($row2 = mysql_fetch_assoc($get2)) { // get data $staffcheck = $row2['staff']; } //display data $get = mysql_query("SELECT * FROM posts ORDER BY id DESC LIMIT $start, $per_page"); while ($row = mysql_fetch_assoc($get)) { // get data $id = $row['id']; $name = $row['name']; $message = $row['message']; if ($staffcheck ==2) { $name = " <img src='$acrown'></img><b> $owner</b></a>"; } //smileys $before = array('', '', '', ''); $after = array('<img src="smileys/happy.png">', '<img src="smileys/sad.png">', '<img src="smileys/wide.png">', '<img src="smileys/tounge.png">'); $output = str_replace($before, $after, $message); if ($name=="$usernamesession") { $name = "<a href='index.php?id=$id'><span style='color:red'>X</span></a> $name"; } echo "<center><b><a href='report.php?id=$id'><img src='images/report.png' alt='Report'></img></a> ($id)Posted by:</b> ".$name."</a><br /><b>".$output."<hr></b>"; } //setup prev and next variables $prev = $start - $per_page; $next = $start + $per_page; //show prev button if (!($start<=0)) echo "<a href='index.php?start=$prev'>Prev</a> "; //show page numbers //set variable for first page $i=1; for ($x=0;$x<$record_count;$x=$x+$per_page) { if ($start!=$x) echo " <a href='index.php?start=$x'>$i</a> "; else echo " <a href='index.php?start=$x'><b>$i</b></a> "; $i++; } //show next button if (!($start>=$record_count-$per_page)) echo " <a href='index.php?start=$next'>Next</a>"; } //prosses of getting the numbers $construct = "SELECT * FROM posts"; $run = mysql_query($construct); $foundnum = (mysql_num_rows($run)); //prosses of getting the numbers for users $construct2 = "SELECT * FROM users"; $run2 = mysql_query($construct2); $foundnum2 = (mysql_num_rows($run2)); echo "<br /><br />Total comments: "; echo $foundnum; echo " ||"; echo " Total members: "; echo $foundnum2; ?> </font></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </center> <table class="tborder" cellpadding="4" cellspacing="1" width="67%"> <tbody> <tr> <td class="thead"><font face="Trebuchet MS"><strong> Copyright</strong></font></td> </tr> <tr> <td class="trow1"> <table border="0" cellpadding="4" width="100%"> <tbody> <tr> <td class="trow1"> <p align="center"> <span class="smalltext" style="display: inline; visibility: visible; font-family: Trebuchet MS; font-weight: 700"> <a title="Simple Machines Forum" target="_blank" class="new_win" href="http://commentbb.com"> <font size="2">Powered by CommentBB 1.0 BETA</font></a><font size="2"> | </font><a href="http://commentbb.com"><font size="2">CBB is © 2009, CommentBB INC</font></a></span></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </div> <font face="Trebuchet MS"> <!-- end: footer --> <!-- end: portal --></font></body></html>
  12. Thank you. I accidentally had it at report.php?=$id Topic solved.
  13. Now when I click it, it still says the error message when id = !$id. <?php require("global_navigation.php"); ?> <?php $name = $_SESSION['username']; $id = $_GET['id']; { if ($_SESSION['username']) { if (!$id) die("You cannot visit this page from your browser address! You must report a post first!"); $ip = $_SERVER['REMOTE_ADDR']; //protection $before = array('^', '<', '>', '`', '*', '<script>', '</script>', ';DROP TABLE users;', 'users', 'DROP', 'TABLE'); $after = array('', '', '', '', '', '', '', '', '', '', ''); $output = str_replace($before, $after, $message); $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); //connect $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); //write $write = mysql_query("INSERT INTO reports VALUES ('','$id','$name')") or die(mysql_error()); echo "<div class='box'><font face='arial'><b><span style='color:green'>Successfully reported post ID ".$id."!"; } } ?>
  14. Oh, lol, I can't believe I didn't see that. -.- Thank you!
  15. Alright, when someone clicks [REPORT] on the index.php, they go to report.php?=id - But how do I get the ID from the URL? Like I click [REPORT] on post id 55 and I go to report.php?=55, how does the page know that it's ID 55? Here's my code: <?php require("global_navigation.php"); ?> <?php $name = $_SESSION['username']; $id = $_POST['id']; { if ($_SESSION['username']) { if (!$id) die("You cannot visit this page from your browser address! You must report a post first!"); $ip = $_SERVER['REMOTE_ADDR']; //protection $before = array('^', '<', '>', '`', '*', '<script>', '</script>', ';DROP TABLE users;', 'users', 'DROP', 'TABLE'); $after = array('', '', '', '', '', '', '', '', '', '', ''); $output = str_replace($before, $after, $message); $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); //connect $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); //write $write = mysql_query("INSERT INTO reports VALUES ('','$id','$name')") or die(mysql_error()); echo "<div class='box'><font face='arial'><b><span style='color:green'>Successfully reported post ID ".$id."!"; } } ?>
  16. MadTechie, no it doesn't. It's suppose to display an OFFLINE message if it's offline or false information.......
  17. I mean when I type in aaa for the IP and 5555 for the port, it gives me an online message. o.O?
  18. Why the hell doesn't it work anyways? I currently don't care about if the user has entered something. I just want to get the damn thing working. And when ever I enter random information it keeps saying it's online. WTF? New code: <?php $server = $_POST['ip']; $port = $_POST['port']; if (!$server || !$port) die ("One of the required fields has not been filled out!"); $status = fsockopen( 'udp://' . $server, $port, $errno, $errstr, 3 ); if ( !$status ) { die('<img src="offline.png" />'); } else { die('<img src="online.png" />'); } ?> Same error as before.
  19. Wait, I fixed an error. I didn't have method="POST" but now I get this error: Warning: fsockopen() expects parameter 2 to be long, string given in /home/a9726309/public_html/server.php on line 5
  20. Sorry for the title. Warning: fsockopen() [function.fsockopen]: unable to connect to udp://:0 (Failed to parse address "") in /home/a9726309/public_html/server.php on line 4 Code: <?php $server = $_POST['ip']; $port = $_POST['port']; $status = fsockopen( 'udp://' . $server, $port, $errno, $errstr, 3 ); if ( !$status ) { //include 'offline.gif'; die('<img src="offline.gif" />'); } else { //include 'online.gif'; die('<img src="online.gif" />'); } ?>
  21. Code: <?php $name = $_GET['name']; ?> <b><textarea name="textarea" cols="40" rows="4" wrap="VIRTUAL"><form method="post" action="http://clubzobbies.com/supportgenerator/action.php"> field name: <input name="<?php echo $name; ?>" type="text" /><br /> field name: <input name="<?php echo $name; ?>" type="text" /><br /> field name:<br /> <textarea name="message" rows="15" cols="40"></textarea><br /> <input type="submit" /> </form> </textarea></b> And when it gives me my code, it has name="", and it doesn't show $name!
  22. Email Failed http://webmasters.webatu.com/
  23. Code: <?php $to = $_POST['to']; $title = $_POST['title']; $message = $_POST['message']; $email = $_POST['from']; mail('$to', '$title', '$message', 'From: $email); echo "Email sent to $to from $email, with the title $title."; ?> Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/a9726309/public_html/emailed.php on line 8
×
×
  • 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.