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

Edited by lovephp
Link to comment
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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.