
Hydrian
Members-
Posts
57 -
Joined
-
Last visited
Never
Everything posted by Hydrian
-
Thorpe would you any clue why nobody can hear me on chat and i +x on the status page
-
try print ('<ul class="cat1"> or what ever);
-
Could this work? RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)/$ index.php?user=$1
-
That dosent expalin to me how to have a page for each user.
-
Can you expalin to me how to do it, and have a default page be in there?
-
Ive got a member system running on my site. I have a basic members page which is the same for each user. I want to know how to make a page for each user. Such as http://www.example.com/members/user. Can anybody help me ?
-
well i want to md5 the passwords. so its safe
-
Topic suposed to be Sha1 Hashing
-
<video> tag is a html . So im quessing the site is in html5. Than the site should only be showin in html5 not html4
-
I have a system for users to register and login. I want to change the normal showing passwords to sha1 hashed passwords. Can you help me by telling me what line would i put the sha1 <? include_once"config.php"; if(isset($_POST['register'])){ $username = $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; $memip = $_SERVER['REMOTE_ADDR']; $date = date("d-m-Y"); if($username == NULL OR $password == NULL OR $email == NULL){ $final_report.= "Please complete the form below.."; }else{ if(strlen($username) <= 7 || strlen($username) >= 30){ $final_report.="Your username must be between 7 and 30 characters.."; }else{ $check_members = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'"); if(mysql_num_rows($check_members) != 0){ $final_report.="The username is already in use!"; }else{ if(strlen($password) <= 6 || strlen($password) >= 30){ $final_report.="Your password must be between 6 and 30 digits and characters.."; }else{ if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){ $final_report.="Your email address was not valid.."; }else{ $create_member = mysql_query("INSERT INTO `members` (`id`,`username`, `password`, `email`, `ip`, `date`) VALUES('','$username','$password','$email','$memip','$date')"); $final_report.="Thank you for registering, you may now login."; }}}}}} ?>
-
I have chat and a loginsystem i want know how to change the color of the users, so i can make like Admin, and Moderators. Im not sure which code you would need. My login page or my index page so here are both <?php session_start(); include_once"loginsystem/config.php"; if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){ echo 'you are not logged in.'; }else { echo 'You are logged in'; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta name="google-site-verification" content="V-MlKGWPoAzJ_-vfEsEZFg92geK_hsIr53hVfcy8ydg" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>TestChat Page</title> <link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="ol.css" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="chat.js"></script> <script type="text/javascript"> // ask user for name with popup prompt var name = <?php echo json_encode((string)$_SESSION['username']); ?>; // default name is 'Username' if (!name || name === ' ') { name = <?php echo json_encode((string)$_SESSION['username']); ?>; } // strip tags name = name.replace(/(<([^>]+)>)/ig,""); // display name on page $("#name-area").html("You are: <span>" + name + "</span>"); // kick off chat var chat = new Chat(); $(function() { chat.getState(); // watch textarea for key presses $("#sendie").keydown(function(event) { var key = event.which; //all keys including return. if (key >= 33) { var maxLength = $(this).attr("maxlength"); var length = this.value.length; // don't allow new content if length is maxed out if (length >= maxLength) { event.preventDefault(); } } }); // watch textarea for release of key press $('#sendie').keyup(function(e) { if (e.keyCode == 13) { var text = $(this).val(); var maxLength = $(this).attr("maxlength"); var length = text.length; // send if (length <= maxLength + 1) { chat.send(text, name); $(this).val(""); } else { $(this).val(text.substring(0, maxLength)); } } }); }); </script> <meta name="Generator" content="Serif WebPlus X6 (14.0.0.020)"> <meta name="vieort" content="width=1000"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <style type="text/css"> body{ padding:20px; color:FFFFFF; font-size:14px; background-color:#454545; font-family:Arial, Helvetica, sans-serif;} h2 {font-weight:bold; color:#000099; margin:10px 0px; } p span {color:#006600; font-weight:bold; } a, a:link, a:visited {color:#FFFFFF;} textarea {width: 100%; margin: 10px 0 15px 0; font-size: 13px; font-family: Consolas,monospace;} textarea.html {height: 300px;} p {margin: 0 0 10px 0;} code, pre {font-family: Consolas,monospace; color: green;} ol li {margin: 0 0 15px 0;} </style> </head> <body onload="setInterval('chat.update()', 1000)"> <br><br><br> <?php if ($_SESSION){ ?> <div id="page-wrap"> <p id="name-area"></p> <div id="chat-wrap"><div id="chat-area"></div></div> <form id="send-message-area"> <p><font size="5">Message: </font></p> <textarea id="sendie" maxlength = '225' ></textarea> </form> </div> <?php } ?> <br><br> </body> </html> <? session_start(); include_once"config.php"; if(isset($_POST['login'])){ $username= trim($_POST['username']); $password = trim($_POST['password']); if($username == NULL OR $password == NULL){ $final_report.="Please complete all the fields below.."; }else{ $check_user_data = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error()); if(mysql_num_rows($check_user_data) == 0){ $final_report.="This username does not exist.."; }else{ $get_user_data = mysql_fetch_array($check_user_data); if($get_user_data['password'] == $password){ $start_idsess = $_SESSION['username'] = "".$get_user_data['username'].""; $start_passsess = $_SESSION['password'] = "".$get_user_data['password'].""; mysql_query ("UPDATE members SET logged_on = 1 WHERE username = '$username'") or die(mysql_error()); $final_report.="You are about to be logged in, please wait... <meta http-equiv='Refresh' content='2; URL=members.php'/>"; }}}} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="../php-tec/css/style.css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title></title> </head> <body><form action="" method="post"> <table width="312" align="center"> <? echo "<tr><td colspan='2'>".$final_report."</td></tr><tr>";?> <tr> <td width="120">Username:</td> <td width="180"><input type="text" name="username" size="30" maxlength="25"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" size="30" maxlength="25"></td> </tr> <tr> <td> </td> <td><input type="submit" name="login" value="Login" /></td> </tr> </table> </form> </body> </html>
-
Iv found this site that shows me it http://www.oasitech.it/blogdotnet/readnews.aspx?idn=6 would i better of using that ? would it be easier ?
-
Can you tell me how to (2) see if there logged in or not. I want to have it show whos online like Hydrian foo bar foobar
-
i dont know what you mean
-
I want to know how to show what users are online for my chat. here is the code that controls if a user is logged in so they can chat. <?php session_start(); include_once"config.php"; if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){ echo '<h4>You are not logged in. Please do so <a href="http://jays.netne.net/loginsystem/login.php">Login</a></h4>'; } else { echo "<h4>You are logged in.</h4>"; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta name="google-site-verification" content="V-MlKGWPoAzJ_-vfEsEZFg92geK_hsIr53hVfcy8ydg" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>TestChat Page</title> <link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="ol.css" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="chat.js"></script> <script type="text/javascript"> // ask user for name with popup prompt var name = <?php echo json_encode((string)$_SESSION['username']); ?>; // default name is 'Username' if (!name || name === ' ') { name = <?php echo json_encode((string)$_SESSION['username']); ?>; } // strip tags name = name.replace(/(<([^>]+)>)/ig,""); // display name on page $("#name-area").html("You are: <span>" + name + "</span>"); // kick off chat var chat = new Chat(); $(function() { chat.getState(); // watch textarea for key presses $("#sendie").keydown(function(event) { var key = event.which; //all keys including return. if (key >= 33) { var maxLength = $(this).attr("maxlength"); var length = this.value.length; // don't allow new content if length is maxed out if (length >= maxLength) { event.preventDefault(); } } }); // watch textarea for release of key press $('#sendie').keyup(function(e) { if (e.keyCode == 13) { var text = $(this).val(); var maxLength = $(this).attr("maxlength"); var length = text.length; // send if (length <= maxLength + 1) { chat.send(text, name); $(this).val(""); } else { $(this).val(text.substring(0, maxLength)); } } }); }); </script> <meta name="Generator" content="Serif WebPlus X6 (14.0.0.020)"> <meta name="vieort" content="width=1000"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <style type="text/css"> body{ color:black; padding:20px; font-size:14px; background-color:#454545; font-family:Arial, Helvetica, sans-serif;} h2 {font-weight:bold; color:#000099; margin:10px 0px; } h4 {color:white;} p span {color:#006600; font-weight:bold; } a, a:link, a:visited {color:#white;} textarea {width: 100%; padding: 10px; margin: 10px 0 15px 0; font-size: 13px; font-family: Consolas,monospace;} textarea.html {height: 300px;} p {margin: 0 0 10px 0;} code, pre {font-family: Consolas,monospace; color: green;} ol li {margin: 0 0 15px 0;} </style> </head> <body onload="setInterval('chat.update()', 500)"> <br><br><br> <?php if ($_SESSION){ ?> <div id="page-wrap"> <p id="name-area"></p> <div id="chat-wrap"><h4></h4><div id="chat-area"></div></div> <form id="send-message-area"> <p><font size="5">Message: </font></p> <textarea id="sendie" maxlength = '225' ></textarea> </form> </div> <?php } ?> <br><br> </body> </html>
-
Got it myself im a genius. Note i suck at php im happy
-
sorry fixed it for you
-
I have a chat room implemented with a login system. The Chat is written in Javascript and the loginsystem is written in PHP. I have echos if a user isnt logged in. I want to know how to make the chat not show if a user isnt logged in. Here is the code that i want the chat to be hidden if not logged in <?php session_start(); include_once"config.php"; if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){ echo '<h4>You are not logged in. Please do so <a href="http://jays.netne.net/loginsystem/login.php">Login</a></h4>'; } else { echo "<h4>You are logged in </h4>"; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta name="google-site-verification" content="V-MlKGWPoAzJ_-vfEsEZFg92geK_hsIr53hVfcy8ydg" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>TestChat Page</title> <link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="ol.css" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="chat.js"></script> <script type="text/javascript"> // ask user for name with popup prompt var name = <?php echo json_encode((string)$_SESSION['username']); ?>; // default name is 'Username' if (!name || name === ' ') { name = <?php echo json_encode((string)$_SESSION['username']); ?>; } // strip tags name = name.replace(/(<([^>]+)>)/ig,""); // display name on page $("#name-area").html("You are: <span>" + name + "</span>"); // kick off chat var chat = new Chat(); $(function() { chat.getState(); // watch textarea for key presses $("#sendie").keydown(function(event) { var key = event.which; //all keys including return. if (key >= 33) { var maxLength = $(this).attr("maxlength"); var length = this.value.length; // don't allow new content if length is maxed out if (length >= maxLength) { event.preventDefault(); } } }); // watch textarea for release of key press $('#sendie').keyup(function(e) { if (e.keyCode == 13) { var text = $(this).val(); var maxLength = $(this).attr("maxlength"); var length = text.length; // send if (length <= maxLength + 1) { chat.send(text, name); $(this).val(""); } else { $(this).val(text.substring(0, maxLength)); } } }); }); </script> <meta name="Generator" content="Serif WebPlus X6 (14.0.0.020)"> <meta name="vieort" content="width=1000"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <style type="text/css"> body{ color:black; padding:20px; font-size:14px; background-color:#454545; font-family:Arial, Helvetica, sans-serif;} h2 {font-weight:bold; color:#000099; margin:10px 0px; } h4 {color:white;} p span {color:#006600; font-weight:bold; } a, a:link, a:visited {color:#white;} textarea {width: 100%; padding: 10px; margin: 10px 0 15px 0; font-size: 13px; font-family: Consolas,monospace;} textarea.html {height: 300px;} p {margin: 0 0 10px 0;} code, pre {font-family: Consolas,monospace; color: green;} ol li {margin: 0 0 15px 0;} </style> </head> <body onload="setInterval('chat.update()', 500)"> <br><br><br> <?php if ($userIsLoggedIn){ ?> <div id="page-wrap"> <p id="name-area"></p> <div id="chat-wrap"><h4></h4><div id="chat-area"></div></div> <form id="send-message-area"> <p><font size="5">Message: </font></p> <textarea id="sendie" maxlength = '225' ></textarea> </form> </div> <?php } ?> <br><br> </body> </html>
-
Im wondering if anyone can help implement a login system into a chat room. so that it reconises if a user is logged in, which allows that user to chat, but if the user is not logged in they cannot chat. I have a database and a site where the chat and the login system is setup on. Please help me
-
Adam that is the code iv made to write my chat.
-
Here you go. This is just the script for the chat. <script type="text/javascript"> // ask user for name with popup prompt var name = prompt("Enter your username:", "Userrname"); // default name is 'Username' if (!name || name === ' ') { name = "username"; } // strip tags name = name.replace(/(<([^>]+)>)/ig,""); // display name on page $("#name-area").html("You are: <span>" + name + "</span>"); // kick off chat var chat = new Chat(); $(function() { chat.getState(); // watch textarea for key presses $("#sendie").keydown(function(event) { var key = event.which; //all keys including return. if (key >= 33) { var maxLength = $(this).attr("maxlength"); var length = this.value.length; // don't allow new content if length is maxed out if (length >= maxLength) { event.preventDefault(); } } }); // watch textarea for release of key press $('#sendie').keyup(function(e) { if (e.keyCode == 13) { var text = $(this).val(); var maxLength = $(this).attr("maxlength"); var length = text.length; // send if (length <= maxLength + 1) { chat.send(text, name); $(this).val(""); } else { $(this).val(text.substring(0, maxLength)); } } }); }); </script> <meta name="Generator" content="Serif WebPlus X6 (14.0.0.020)"> <meta name="vieort" content="width=1000"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <style type="text/css"> body{padding:20px; font-size:14px; background-color:#454545; font-family:Arial, Helvetica, sans-serif;} h2 {font-weight:bold; color:#000099; margin:10px 0px; } p span {color:#006600; font-weight:bold; } a, a:link, a:visited {color:#0000FF;} textarea {width: 100%; padding: 10px; margin: 10px 0 15px 0; font-size: 13px; font-family: Consolas,monospace;} textarea.html {height: 300px;} p {margin: 0 0 10px 0;} code, pre {font-family: Consolas,monospace; color: green;} ol li {margin: 0 0 15px 0;} </style> </head> <body onload="setInterval('chat.update()', 1000)"> <h3> McOfficialRecords | <a href="http://www.mcofficialrecords.co.cc/forum/viewtopic.php?f=9&t=5" title="Full Chat Rules" target="_blank">Read Full Chat Rules</a> - opens in new window</li> </h3> </div> <br><br><br> <div id="page-wrap"> <h2> <form name='form1'><input type='button' value="Lobby" onClick="self.location='#'" class="btn"> <form name='form1'><input type='button' value="Records" onClick="self.location='http://www.mcofficialrecords.co.cc/chat/js_chat//'" class="btn"> <form name='form1'><input type='button' value="Servers" onClick="self.location='http://www.mcofficialrecords.co.cc/chat/servers/'" class="btn"> <form name='form1'><input type='button' value="Site/Law" onClick="self.location='http://www.mcofficialrecords.co.cc/chat/site/'" class="btn"> </form> </h2> <p id="name-area"></p> <div id="chat-wrap"><div id="chat-area"></div></div> <form id="send-message-area"> <p><font size="5">Message: </font></p> <textarea id="sendie" maxlength = '225' ></textarea> </form> </div>
-
Im confused, but i use javascript in the chat, i want to have the emotes to show and when clicked or when typed they show instead of the chars
-
I want to put $message = str_replace("", "<img src="..." />", $message) in this script so i will make emotes, but i think i need to change my javascript. Can you show me where to put it and what to change please? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta name="google-site-verification" content="V-MlKGWPoAzJ_-vfEsEZFg92geK_hsIr53hVfcy8ydg" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>McOfficialRecords | Creating the best</title> <link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="ol.css" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="chat.js"></script> <script type="text/javascript"> // ask user for name with popup prompt var name = prompt("Enter your username:", "Userrname"); // default name is 'Username' if (!name || name === ' ') { name = "username"; } // strip tags name = name.replace(/(<([^>]+)>)/ig,""); // display name on page $("#name-area").html("You are: <span>" + name + "</span>"); // kick off chat var chat = new Chat(); $(function() { chat.getState(); // watch textarea for key presses $("#sendie").keydown(function(event) { var key = event.which; //all keys including return. if (key >= 33) { var maxLength = $(this).attr("maxlength"); var length = this.value.length; // don't allow new content if length is maxed out if (length >= maxLength) { event.preventDefault(); } } }); // watch textarea for release of key press $('#sendie').keyup(function(e) { if (e.keyCode == 13) { var text = $(this).val(); var maxLength = $(this).attr("maxlength"); var length = text.length; // send if (length <= maxLength + 1) { chat.send(text, name); $(this).val(""); } else { $(this).val(text.substring(0, maxLength)); } } }); }); </script> <meta name="Generator" content="Serif WebPlus X6 (14.0.0.020)"> <meta name="vieort" content="width=1000"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <style type="text/css"> body{padding:20px; font-size:14px; background-color:#454545; font-family:Arial, Helvetica, sans-serif;} h2 {font-weight:bold; color:#000099; margin:10px 0px; } p span {color:#006600; font-weight:bold; } a, a:link, a:visited {color:#0000FF;} textarea {width: 100%; padding: 10px; margin: 10px 0 15px 0; font-size: 13px; font-family: Consolas,monospace;} textarea.html {height: 300px;} p {margin: 0 0 10px 0;} code, pre {font-family: Consolas,monospace; color: green;} ol li {margin: 0 0 15px 0;} </style> </head> <body onload="setInterval('chat.update()', 1000)"> <h3> McOfficialRecords | <a href="http://www.mcofficialrecords.co.cc/forum/viewtopic.php?f=9&t=5" title="Full Chat Rules" target="_blank">Read Full Chat Rules</a> - opens in new window</li> </h3> </div> <br><br><br> <div id="page-wrap"> <h2> <form name='form1'><input type='button' value="Lobby" onClick="self.location='#'" class="btn"> <form name='form1'><input type='button' value="Records" onClick="self.location='http://www.mcofficialrecords.co.cc/chat/js_chat//'" class="btn"> <form name='form1'><input type='button' value="Servers" onClick="self.location='http://www.mcofficialrecords.co.cc/chat/servers/'" class="btn"> <form name='form1'><input type='button' value="Site/Law" onClick="self.location='http://www.mcofficialrecords.co.cc/chat/site/'" class="btn"> </form> </h2> <p id="name-area"></p> <div id="chat-wrap"><div id="chat-area"></div></div> <form id="send-message-area"> <p><font size="5">Message: </font></p> <textarea id="sendie" maxlength = '225' ></textarea> </form> </div> <br><br> </body> </html>