empty Posted May 6, 2007 Share Posted May 6, 2007 hi all could any one help me and tell me what's wrong in this script I don't get it I am looking at it from 2 weeks and I couldn't find the mistake <html> <head> <title>Chat</title> </head> <body> <h1>Chat</h1> <form method="post"> Login: <input type="text"name="login" size="20" maxlength="20">; <?php value "$login" <lt><br> <gt></lt></br> </gt>; Message: <input type="text" name="message" size="35" maxlength="255"> <input type="submit" name="send" value="Send"; <lt><br> <gt></lt></br> </gt>; </form> ?> <?php include("inc_connect.php"; function addMessage( $login, $message ) { $login = mysql_real_escape_string(strip_tags( $login )); $message = mysql_real_escape_string(strip_tags( $message, <lt><gt></lt></gt><lt><gt></lt></gt>)); $itstime = date("H:i:s"); mysql_query( "INSERT INTO minichat ( login, message, itstime ) VALUES ( '$login','$message', '$itstime' )"); } if ( isset( $_POST['send'] )) { if ( $login == '' ) { echo span style="color:red"; .('Hey, what\'s your name anyway?') . "</span><br />"; } elseif ( $message == '' ) { echo "<span style=\"color:red\">" .('Say something or shout it out! Uhm ... no, type it in!') . "</span><br />"; } else { addMessage( $_POST['login'], $_POST['message'], $_POST['itstime'] ); } } function printMessages() { //ORDER BY id DESC LIMIT 0,10: Biggest id first, so newest message first $rs = mysql_query( "SELECT * FROM minichat ORDER BY id DESC LIMIT 0,10" ); while ( $msg = mysql_fetch_array( $rs )) { $msg['message']=wordwrap($msg['message'], 75, echo span style="color:blue"<gt>; . $msg['login'] . " (" . $msg['itstime'] . ")span style="color:navy"; } } printMessages(); mysql_close($db); ?> </body> </html> and there is the other file <?php $db = mysql_connect("localhost","root","password") or die ("Connection failed!"); mysql_select_db("minichat"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/50271-solved-mini-chat-script/ Share on other sites More sharing options...
skali Posted May 6, 2007 Share Posted May 6, 2007 What are the errors/issues you are getting.. Quote Link to comment https://forums.phpfreaks.com/topic/50271-solved-mini-chat-script/#findComment-246753 Share on other sites More sharing options...
MadTechie Posted May 6, 2007 Share Posted May 6, 2007 looks like here $msg['message']=wordwrap($msg['message'], 75, echo span style="color:blue"<gt>; . $msg['login'] . " (" . $msg['itstime'] . ")span style="color:navy"; } } what did your last slave die of ? Quote Link to comment https://forums.phpfreaks.com/topic/50271-solved-mini-chat-script/#findComment-246763 Share on other sites More sharing options...
empty Posted May 7, 2007 Author Share Posted May 7, 2007 The error looks like this Parse error: syntax error, unexpected '"' in E:\xampp\htdocs\chat\index.php on line 12 where line 12 is this value "$login" Quote Link to comment https://forums.phpfreaks.com/topic/50271-solved-mini-chat-script/#findComment-247038 Share on other sites More sharing options...
MadTechie Posted May 7, 2007 Share Posted May 7, 2007 yep thats an error, not a valid command Quote Link to comment https://forums.phpfreaks.com/topic/50271-solved-mini-chat-script/#findComment-247190 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.