lovephp Posted November 28, 2012 Share Posted November 28, 2012 (edited) how can i send users login details to my chat room through a url than to enter info on form? chatenter.php page looks like this <? include("chat.php"); clearinactiveusers(); // delete inactive users if ($_POST) { if (isset($_POST['username'])) { $result = enterchat($_POST['username'], $_POST['password']); if ($result!="") header("Location: ./?msg=".urlencode($result)); } } else { header("Location: ./"); } ?> and the form.php its kinda like <form method="post" action="chatenter.php"> <table align="center" border="0" cellpadding="0" cellspacing="10"> <tr><td>Username:</td><td><input type="text" name="username" size="15" maxlength="<? echo max_user_len; ?>"></td></tr> <tr><td>Password:</td><td><input type="password" name="password" size="15" maxlength="10"></td></tr> <tr> <td align="center" colspan="2"><input type="submit" value="ENTER CHATROOM"></td> </tr> </table> </form> im actually want to send the user to chat room like chatenter.php?username=name&password=name Edited November 28, 2012 by lovephp Quote Link to comment https://forums.phpfreaks.com/topic/271314-send-login-details-via-url-not-form/ Share on other sites More sharing options...
mrMarcus Posted November 28, 2012 Share Posted November 28, 2012 how can i send users login details to my chat room through a url than to enter info on form? chatenter.php page looks like this <? include("chat.php"); clearinactiveusers(); // delete inactive users if ($_POST) { if (isset($_POST['username'])) { $result = enterchat($_POST['username'], $_POST['password']); if ($result!="") header("Location: ./?msg=".urlencode($result)); } } else { header("Location: ./"); } ?> and the form.php its kinda like <form method="post" action="chatenter.php"> <table align="center" border="0" cellpadding="0" cellspacing="10"> <tr><td>Username:</td><td><input type="text" name="username" size="15" maxlength="<? echo max_user_len; ?>"></td></tr> <tr><td>Password:</td><td><input type="password" name="password" size="15" maxlength="10"></td></tr> <tr> <td align="center" colspan="2"><input type="submit" value="ENTER CHATROOM"></td> </tr> </table> </form> im actually want to send the user to chat room like chatenter.php?username=name&password=name You don't want to pass someone's login credentials through a URL. What exactly is your usage for this that a POST form could not allow for? Or do you just like the way it looks? Quote Link to comment https://forums.phpfreaks.com/topic/271314-send-login-details-via-url-not-form/#findComment-1396018 Share on other sites More sharing options...
lovephp Posted November 28, 2012 Author Share Posted November 28, 2012 actually i already for a login system and i found this free chat script where u do not need to register u just enter username and password and start chatting, im tryin to send my logged in site users to get into chatroom with the above code in chatenter.php but not sure how to make the url. which will send the data accordingly to what chatenter.php requires Quote Link to comment https://forums.phpfreaks.com/topic/271314-send-login-details-via-url-not-form/#findComment-1396019 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.