However, I DO still have some problems/issues that I would love to see if people could answer for me....
It's basically dealing with php in itself. I have found in my expierience as a programmer, the better way ( not always the best ) to understand new code is to look at how other's use the syntax's involved, and ways they are setting up the code to work as it progresses...
However, heh, php is a little bit different from the rest
For example, a login script. You build a script that is going to make calls to a MySQL database to lookup validations on a Username/Password, and if it's there, you redirect them to another page, or yadda yadda yadda...
My problem lies here... I do not understand how to make php do these things.
Here is a better eplanation. I am using the following script :
Code: Select all
<?
# Login Code Written by Matt Slavin
# Email Me At neophite17@hotmail.com for questions or comments.
if((!$Username) | (!$Password)) {
print ("Please Enter In THe Correct Name");
}
mysql_connect("localhost","User_Name_here","Password_Here");
mysql_select_db("My_Database_Here");
# This part is sort if ya want to. I would suggest it.
# Make your login page have the main value of Password
#Comment Out if you Want too
$Password = md5($Password);
$sql = "select * from My_Table where Password=$Password and Username=$Username";
$result = mysql_query($sql);
$num = mysql_numrows($result);
# If Login Is Okay Do What You Want TO DO to Them
if ($num == "1") {
print ("Logged in okay");
#Or you can send them somwhere nice like hawaii
header("Location: http://localhost/bob/success.htm");
exit;
# or even fetch feild about them or save sessions
session_start();
session_register(Username);
}
# And we must a have a default error message if login fails
if ($num == "0"){
print ("Sorry Bub You Need Some Manners In Password");
}
?>When I load this script, all it does is give me a blank page with NO OUTPUT, and with NO INPUT possibilities ( ie, no boxes asking for a username/password, etc. etc ... )
My question is, do I have to create an HTML/PHP file that asks for the login/password, and then in the ON-SUBMIT clause through them over to the login.php script, or am I just missing something here? And, if I am suposed to do it like I think I am, could someone give me a small example of how this works?
Sorry for being a pain, but as I said, I'm still in the learning process... Again, I have already read the manual ( which does not help. Basically just gives you the syntaxes that are supported in php, but no basic idea of how to handle such script applications .... )
Thanks in advance!