Login account with MySQL

Codes here !

Moderators: macek, egami, gesf

Ihoss
New php-forum User
New php-forum User
Posts: 17
Joined: Sun Mar 30, 2003 11:41 pm
Contact:

Login account with MySQL

Postby Ihoss » Mon Mar 31, 2003 9:52 am

i'm trying to make an account database where people can join and log in and out. ive managed to make the sign up and im working on login. does anyone know how to add 'post' data to a url. if i send(as in method="send") it, the user will se it, and i dont want people to see the passwords and names. ive used the code below to open the php file and check if the password/username is right:

Code: Select all

$db = mysql_connect();
$sql="SELECT Username,Password FROM `member` WHERE Username='$Username' AND Password='$in_password'";
$res = mysql_query($sql, $db) or die(mysql_error());
$num = mysql_num_rows($res);
if($num == "0"){
header("Location: login.htm");
echo "error";
}else{
header("Location: myaccount.php?Username=$Username&in_password=$in_password");
}

instead of using the myaccount.php?Username=$Username&in_password=$in_password code i want to use a code where the data doesent show up. maybe ive repeated myself some times by now but i dont know how to explain it. it should work like post in html forms. :?:

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Mon Mar 31, 2003 11:12 pm

What is the method??????? method="send" thare are no eny method. Thare are just GET and POST (and PUT) methods.


how you can do without string of usermname and password - just use cookies or sesions.

Ihoss
New php-forum User
New php-forum User
Posts: 17
Joined: Sun Mar 30, 2003 11:41 pm
Contact:

Postby Ihoss » Tue Apr 01, 2003 9:47 am

im getting a parse error (not that i know what it is) on this code on line 12:

Code: Select all

<?php
$db = mysql_connect();
$sql="SELECT Username,Password FROM `member` WHERE Username='$Username' AND Password='$in_password'";
$res = mysql_query($sql, $db) or die(mysql_error());
$num = mysql_num_rows($res);
if($num == "0"){
header("Location: login.htm");
}else{
header("Location: myaccount.php);
}
mysql_free_result($res);
?>


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron