ID:274826
 

Name*

Up to here it is easy then I don't know howto add the Name and Password information to the e-mail then add that Data to a MySQL database

Can anyone help me?
DBZ Kidd wrote:
<form action="php.php" method="POST">
<input type=text name="name"> Name*
<input type=text name="pword> Password*
<input type=submit value=Submit>

Your name is <?php print $_POST['name']; ?> correct?
Your password is <?php print $_POST['pword']; ?> correct?
<form action=mailto:[email protected] method="POST">
Up to here it is easy then I don't know howto add the Name and Password information to the e-mail then add that Data to a MySQL database

Can anyone help me?

something things to note

you dont have to use $_POST["whatever"]
php lets you use the name as a direct variable, like
$whatever

i dont know why you are trying to put it to email, then to a data base, just write directly to the data base!

to show the login, you use this for a link
thisfile.php?action=showlogin

from there on, the file will take care of the rest of the navigation, if you set it up right...

<?php
if($action=="showlogin"){
echo("<form action=thisfile.php method=post>");
echo("<input type=hidden name=action value=login>");
echo("username:<input type=text name=un>");
echo("password:<input type=password name=pwd>");
echo("<input type=submit value=Go>");
echo("</form>");
<font color=green>//this will show the login page,
//when they click the button,
//it will do what follows...</font>
}
if($action=="login"){
if($un & $pwd){<font color=green>//check to see if they even typed in anything</font>
$db=mysql_connect("localhost","user","pass");
$com="SELECT password FROM users WHERE username='$un';";
$result=mysql_db_query("yourdbhere",$com);
if(mysql_num_rows($result)>0){<font color=green>//if there was result</font>
if($pwd==mysql_result($result,0)){<font color=green>//test inputed pwd against real password</font>
echo("Yeah!");<font color=green>//it was right</font>
}
else{
echo("Nope!");<font color=green>//it was wrong</font>
}
}
else{
echo("Nope");<font color=green>//there was no result</font>
}
mysql_close($db);
}
else{
echo("You must supply a username AND password!");
<font color=green>//they didnt type in anything!</font>
}
}
?>
this is like a basic php script for user accounts, but you need to specify how your table is set up, and how your db is set up, then i can help you further
In response to FIREking
did you ever get this solved? if not, you can email me and ill just help you privately

[email protected]