PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?
$conn = mysql_connect("e;localhost"e;,"e;gaogier"e;,"e;*******"e;);
$db = mysql_select_db("e;gaogier_javelincontrols"e;);
$username = $_POSTї"e;username"e;];
$password = $_POSTї"e;password"e;];
$result = MYSQL_QUERY("e;SELECT * from users WHERE username='$username'and password='$password'"e;)
or die ("e;Name and password not found or not matched"e;);
$worked = mysql_fetch_array($result);
$username = $workedїusername];
$password = $workedїpassword];
$email = $workedїemail];
if($worked)
echo "e;Welcome $user! Your e-mail address is $email"e;;
?>
how can i make it so that when they sign up it sends them an email saying what there pass and user is? and how can i make this go further? so people can see there info that nobody else can see?
@$link_id = mysql_connect("IP", "USER", "PASSWORD") or die("Connection Failed");
// Make sure that the user has the priveleges necessary
$select_db = mysql_select_db("DATABASE",$link_id) or die("Connection Failed");
$variable=("SELECT phone FROM TABLE WHERE user='$USER' AND password='$PASSWORD'");
while ($query_data=mysql_fetch_array($variable)){
echo $query_data["phone"];
}
Keep in mynd that $user and $password must have a certain value that you bring with $_POST or $_SESSION
In the page where you want to obtain certain information of the table, according to the user and password to make any kind of validation, I put the phone there as an example with mysql_fetch_array. but you can use mysql_fetch_row, but in order to print it is different.
if you want to obtain more info you have to modify the query and the way you call the variables, that is:
$variable=("SELECT phone,id FROM TABLE WHERE user='$USER' AND password='$PASSWORD'");
while ($query_data=mysql_fetch_array($variable)){
echo $phone=$query_data["phone"];
echo $id=$query_data["id"];
}