FortMyersDrew Posted June 26, 2007 Author Share Posted June 26, 2007 Uploaded... And you think maybe tomorrow you can help me make like an admin file or what not where i can delete things and also a bad word filter? I have an admin file that me and friend made but i cant get it to work i dont know what im missing Link to comment https://forums.phpfreaks.com/topic/57177-shoutbox-editing-help/page/3/#findComment-282630 Share on other sites More sharing options...
Pastulio Posted June 26, 2007 Share Posted June 26, 2007 I don't think I'll be here tomorrow lol upload this as doit.php <?php //including the database connection include('config.php'); //getting everything that has been submitted $name=mysql_real_escape_string(strip_tags($_POST['name'])); $mail=mysql_real_escape_string(strip_tags($_POST['mail'])); $message=mysql_real_escape_string(strip_tags($_POST['message'])); $submit=$_POST['submit']; //get the current time with php date() function //note that the server time will be recorded //more info about all functions - http://php.net $time=date("m/d/y - g:i a"); //get the ip. Note that this wont see through proxies $ip=$_SERVER['REMOTE_ADDR']; //just some basic error checking which //checks if name,e-mail and message //hasnt been left blank or with default text if (($name!=="") || ($name!=="Name") || ($mail!=="") || ($mail!=="E-mail") || ($message!=="") || ($message!=="Your text")) { //inserts data into the database $sql = "INSERT INTO shoutbox (id, name, mail, message, time, ip) VALUES ('NULL', '$name', '$mail', '$message', '$time', '$ip')"; mysql_query($sql) or die(mysql_error()); $query = "SELECT * FROM `shout_user_log` WHERE `ip` = '$ip'"; $result = mysql_query ($query); $num_rows = mysql_num_rows ($result); if ($num_rows > 0) { $query = "DELETE * FROM `shout_user_log` WHERE `ip` = '$ip'"; mysql_query ($query); } $query = "INSERT INTO `shout_user_log` (`id`, `username`, `email`, `ip`) VALUES ('', '$name', '$mail', '$ip')"; mysql_query ($query); //sends the user back to the form header("Location:".$_SERVER['HTTP_REFERER']); } else{ header("Location:".$_SERVER['HTTP_REFERER']); } ?> Now the name and E-mail should be remembered Link to comment https://forums.phpfreaks.com/topic/57177-shoutbox-editing-help/page/3/#findComment-282631 Share on other sites More sharing options...
FortMyersDrew Posted June 26, 2007 Author Share Posted June 26, 2007 nope no luck.. and its ok i added ya to friends list Maybe we can do the admin and the badword filter another time. Link to comment https://forums.phpfreaks.com/topic/57177-shoutbox-editing-help/page/3/#findComment-282634 Share on other sites More sharing options...
Pastulio Posted June 26, 2007 Share Posted June 26, 2007 sure but I gotta go i'll check my error tomorrow somewhere cya Link to comment https://forums.phpfreaks.com/topic/57177-shoutbox-editing-help/page/3/#findComment-282636 Share on other sites More sharing options...
FortMyersDrew Posted June 26, 2007 Author Share Posted June 26, 2007 alright bye see ya later Link to comment https://forums.phpfreaks.com/topic/57177-shoutbox-editing-help/page/3/#findComment-282637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.