[V]enom
07-07-2007, 11:29 AM
Hi,
I would like to create my own login... on my website...
with PHP and MySQL, I've created a database called dieknights, with a table called memb_info
and now I want to have a login on my index.php, how do I do that?
1. create link to login.php ?
or
2. put the login on index.php with include();
or
3. put the login on index.php in a frame?
or
...
now my example:
I've sepereated it:
//index.php
<a href="login.php">To the Login</a>
__________________________________
//login.php
<form action="loggedin.php" method="post">
Name: <input type="text" name="membid"><br>
Passwort:<input type="text" name="pwid"><br>
<input type="submit" value="Login">
</form>
__________________________________
//loggedin.php
<?php
//Variable
$name = $_POST['membid'];
$pw = $_POST['pwid'];
//Check:
if (isset($name) && $pw != "")
{
//SQL query(code):
what goes here? I think:
if $pw = pwd_id("SELECT * FROM memb_info WHERE memb_id=$name");
or something...
?>
what do i need to put at the sql query i mean how can i make a check if the $name exists and if yes, check if the $pw is the right one....
I would be very thankful for help!
I would like to create my own login... on my website...
with PHP and MySQL, I've created a database called dieknights, with a table called memb_info
and now I want to have a login on my index.php, how do I do that?
1. create link to login.php ?
or
2. put the login on index.php with include();
or
3. put the login on index.php in a frame?
or
...
now my example:
I've sepereated it:
//index.php
<a href="login.php">To the Login</a>
__________________________________
//login.php
<form action="loggedin.php" method="post">
Name: <input type="text" name="membid"><br>
Passwort:<input type="text" name="pwid"><br>
<input type="submit" value="Login">
</form>
__________________________________
//loggedin.php
<?php
//Variable
$name = $_POST['membid'];
$pw = $_POST['pwid'];
//Check:
if (isset($name) && $pw != "")
{
//SQL query(code):
what goes here? I think:
if $pw = pwd_id("SELECT * FROM memb_info WHERE memb_id=$name");
or something...
?>
what do i need to put at the sql query i mean how can i make a check if the $name exists and if yes, check if the $pw is the right one....
I would be very thankful for help!