teng84 Posted June 27, 2007 Share Posted June 27, 2007 header('Refresh:2;admin.php'); exit(); thats the error you cant echo anything on top of headers in your part you have alot of echo and the html are being displayed any comment that first or remove then tell me wat happen Quote Link to comment Share on other sites More sharing options...
FortMyersDrew Posted June 27, 2007 Author Share Posted June 27, 2007 wait do what to it? sorry you have to be more explanatory Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 27, 2007 Share Posted June 27, 2007 header('Refresh:2;admin.php'); exit(); thats the error you cant echo anything on top of headers in your part you have alot of echo and the html are being displayed any way comment that first or remove then tell me wat happen remove this first then you will then youll find the answer header('Refresh:2;admin.php'); exit(); brf explntion when the header execute theres should be output on the screen or i said echo and output through html Quote Link to comment Share on other sites More sharing options...
FortMyersDrew Posted June 27, 2007 Author Share Posted June 27, 2007 Ahh that works fine. Now i have another question if ya think ya could help me. A curseword filter and a shout timer like a delay between shouts ALSO: is there a way to seperate each shout in the admin by each shout like 1 shout per line Quote Link to comment Share on other sites More sharing options...
FortMyersDrew Posted June 27, 2007 Author Share Posted June 27, 2007 Also is there a way to clear ALL shouts at once? Sheesh I must be annoying also I found a glitch in the coding. If you type one long word like AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA You can keep doing this and it shows up all over the screen. is there a way to set a character limit per word? Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 27, 2007 Share Posted June 27, 2007 i dont understand butis this wat you mean switch($cmd) { case 'delete': $sql = "DELETE FROM shoutbox WHERE id=".$idg.""; $result = mysql_query($sql); header('Refresh:2;admin.php'); exit(); break; default: $result = mysql_query("select * from shoutbox order by id desc"); while($r=mysql_fetch_array($result)) { $name=$r["name"]; $message=$r["message"]; $time=$r["time"]; $id=$r["id"]; echo "Shout by: ".$name." <strong>@</strong> ".$time." ".$message." <a href='?cmd=delete&id=".$id."'>Delete me[/url] "; } break; } any way that the right way Quote Link to comment Share on other sites More sharing options...
FortMyersDrew Posted June 27, 2007 Author Share Posted June 27, 2007 wait where does that go? Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 27, 2007 Share Posted June 27, 2007 <?php session_start(); //Get the cmd variable $cmd=$_GET['cmd']; $idg=$_GET['id']; //include config.php include 'config.php'; //get the username from the form and add some security //so you cant get hacked so easy $username = mysql_real_escape_string(strip_tags(htmlspecialchars($_POST['username']))); $password = md5($_POST['password']); //if login button is pressed if ($_POST['login']){ //check if username and password are inserted if((!$username) || (!$password)){ //if not tell them to...do insert all of info //echo "Please enter both values"; } //when they have we check if the username and the password exists $sql = mysql_query("SELECT * FROM `shoutbox_admin` WHERE `name` = '$username' AND `password`= '$password'") OR die(mysql_error()); //so we need to check it for real //mysql_num_rows() counts the rows which are returned as true $login_check = mysql_num_rows($sql); //if the check is true....true = 1 and $login check is set as $login_check=1 if($login_check > 0){ //so if it is larger than 1 we set some session variables - //username and id $r=mysql_fetch_array($sql); $_SESSION['id'] = $r['id']; $_SESSION['username'] = $r['name']; //if it's not let's make him suffer...moahahahaa... //reload the page I mean.. }else { header("Refresh:2;admin.php"); exit(); } } //so if session username isn't set show user the login form if(!isset($_SESSION['username'])){ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <title>ACP</title> </head> <body> <center> <form action='<?=$_SERVER['PHP_SELF']?>' method='POST'> Username: <input type='text' size='15' name='username'> Password: <input type='password' size='15' name='password'> <input name="login" type="submit" value="Submit"> </form></center> <? } //if not - show him the contents and stuff...else{ else{ //welcome message and logout link... echo "<center>Welcome, ". $_SESSION['username'] ."! <a href='logout.php'>Log Out[/url]</center>"; echo " <center>"; //see my ?id= browsing tutorial to understand switch() switch($cmd) { case 'delete': $sql = "DELETE FROM shoutbox WHERE id=".$idg.""; $result = mysql_query($sql); header('Refresh:2;admin.php'); exit(); break; default: $result = mysql_query("select * from shoutbox order by id desc"); while($r=mysql_fetch_array($result)) { $name=$r["name"]; $message=$r["message"]; $time=$r["time"]; $id=$r["id"]; echo "Shout by: ".$name." <strong>@</strong> ".$time." ".$message." <a href='?cmd=delete&id=".$id."'>Delete me[/url] "; } break; } } ?> Quote Link to comment Share on other sites More sharing options...
FortMyersDrew Posted June 27, 2007 Author Share Posted June 27, 2007 That didnt do anything and what i Mean is this Shout 1 Shout 2 Shout 3 Shout 4 Shout 5 Etc... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.