Jump to content

Send Login Details Via Url Not Form?


lovephp

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/271314-send-login-details-via-url-not-form/
Share on other sites

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?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.