Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

With this code where do I go 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I am struggling to use the HTML below as a start for a log in. Can someone tell me what extra bits I need to interface this to a MySql database on a hosted site. In other words point out in the code the relevant connection bit if its there. Any useful pointers of simple link methods from web page to DB very much appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Login</title>
</head>

<body>

<h1>Application Login Page</h1>

<form method="POST" action="logincheck.php">
<table>
<tr>
<td>Enter your username:</td>
<td><input type="text" size="10" name="loginUsername"></td>
</tr>
<tr>
<td>Enter your password:</td>
<td><input type="password" size="10" name="loginPassword"></td>
</tr>
</table>
<p><input type="submit" value="Log in"> </p>
</form>
</body>
</html>
 
I'll assume you have a working web server.

You'll need a PHP interpreter.

Since the form submits to logincheck.php, you'll need that script. It will contact the MySQL server and try to verify user-submitted credentials against the database.

You'll probably need other scripts which do interesting things.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Many thanks. Is there an easier way to do it. Basically I just want a user input to be checked on a MySql database to verify their name is there. Something as simple as Dog,Cat,Mouse. If this matched then they go further. I have spent hours searching for examples and getting nowhere. Thanks
 
Thanks. It seems unbelievable how a simple process, an every day task, is filled with such complexity. Makes me wonder what planet the people are on when they develop software applications. Even just finding how to display a column from a database on a web page with PHP is like finding water in the desert. I now don't believe anyone's been on the moon. Have a star for your advice, regards
 
Honestly, it's not the fault of the internet or any of your fellow participants that you get the wrong answers when you ask the wrong questions. Your original question, "Can someone tell me what extra bits I need to interface this to a MySql database on a hosted site?" should have been answered with a simple "Yes", as I am sure someone could.

You want PHP questions answered? First, post in the PHP forum (forum434). Then ask meaningful questions, like "Where can I see example PHP code for retrieving and displaying data from a MySQL database?" Someone then might show you to the example code that is given in the PHP online manual page entry for mysql_fetch_array()


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Sleipnir is right. I can't seem to avoid finding MySQL-related function documentation when I visit which is the first place that any PHP developer should look. Enter "mysql" in the search and you'll be rewarded with a plethora of functions with their descriptions, syntax, and user-submitted examples.

Also, you have to remember that a computer program can be easy to use because a programmer (in this case, you) made it that way. You've left the realm of the end user and ventured into the inner workings of software. It's not always supposed to be simple point & click here, it's up to you to make it that way.
 
Thankyou very much for the PHP link. I tried to put my question in as a very basic starting point. Your comments accepted, have a good weekend and thanks again.
 
Thanks lgarner, I had been putting MySql before PHP (cart before the horse). Yes the PHP manual is very good. Have a good weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top