answersLogoWhite

0


Best Answer

First create a form:

Now create a page called login.php. The "name" field in the input is what goes to $_POST so the input named username is $_POST['username']. The value of the input is what the $_POST is.

$username = $_POST['username'];

$password = $_POST['password']; //Change the $_POST string names so it's easier to type

$username = mysql_real_escape_string($username);

$password = mysql_real_escape_string($password); //Add some security so no one can XSS your site.

$link = mysql_connect('mysql_server','mysql_username','mysql_password')

OR die(mysql_error()); //Connect to the mysql database or kill the script and display the error

$db = mysql_select_db('mysql_db',$link); //Connect to database

if(!$db)

{

die(mysql_error()); //If you can't connect to the database kill the script

}

$mysql = "INSERT INTO mysql_table(username,password)

VALUES('$username','$password'); //THE INSERT statement to insert the username and password into the mysql_table

if(!mysql_query($mysql)) //Insert into mysql_table

{

die(mysql_error()); //If it can't be inserted into the table kill the script

}

?>

Everything that is in italics needs to be changed to fit how Mysql is set up on your server.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can i make a logging program and attach a database to it that when i insert a username and pass it goes on the database?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why will you probably not be able to attach a Microsoft Access database file to an email?

lost file


Which type of attack does not need attach itself to another program to function?

worm


A good youtube username for a boy who likes tech?

It all depends on the boy. If he likes tech stuff and he is a geek (in a cool way) you can make his username techgeek and attach initials or a favourite number. These are my suggestions: Techgeek Technologic techboy Tech


How do you forward a flip video to email?

You would select to "Attach" a file to the email. Where the Attach function is located on the Menu Bar would depend on the Email Program that you are using, but it probably is simply labeled as 'Attachment'.


What is piggybacking?

While worms do not need another program to attach themselves to, viruses do. Piggybacking refers to the way that viruses infect or attach themselves to legitimate programs or documents to sneak onto your computer and attempt to infect it.


How do you EMAIL MY pictures from window 7?

Write your email, then attach each picture you want to send - the email program will do the rest !


Can you Email pictures?

Yes, you can either send it as picture in the email itself or attach it to the email. How you do that you can read in the help documentation of your email program.


How to attach a file in e-mail explain in directions?

It depends on the email provider program. Look for an icon that says "Attach" or "Attachment". Click it. It will open your filing system on your computer. Navigate to the folder and file. Double Click on the exact filename. You should see a bar on the email program that shows it is uploading the file. When it is done, you will see the filename without any bar. Now you can finish and send your mail.


What computer virus attaches itself to another computer program?

Attach to emails files programmes etc


What is the present tense of attach?

The present tense of "attach" is "attach."


How do you attach files using email?

You press "Attach" on a message. Navigate to the file you want to attach. Click the file name; it should then be "attached". If attached, you will see the file name at the top of the Write Mail window you have open.


How do you make your own robot?

If you want an NXT robot, make it with Lego pieces and don't forget to attach the NXT device on it! Then, you program it, then your done! Signed by Tannermo