Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ************************************forms.php**************************************************************
- <html>
- <head>
- <title>AirZooka ftw</title>
- </head>
- <body>
- <form action="test.php" method="post">
- Username: <input type="text" name="username" value="" /><br />
- <br />
- Password: <input type="password" name="password" value="" /><br />
- <br />
- Name: <input type="text" name="name" value="" /><br />
- <br />
- Address: <input type="text" name="address" value="" /><br />
- <br />
- Country: <input type="text" name="country" value="" /><br />
- <br />
- Zip Code: <input type="text" name="zip" value="" /><br />
- <br />
- Phone Number: <input type="text" name="phone" value="" /><br />
- <br />
- Email: <input type="text" name="email" value="" />
- <br />
- <input type="submit" />
- </form>
- </body>
- </html>
- **************************************************test.php**********************************************************
- <html>
- <head>
- <title>Shit</title>
- </head>
- <body>
- <?php
- //defining username, password, and database variables so I can easily change them later.
- $username="root";
- $password="tacotruck";
- $database="form";
- $username=$_POST['username'];
- $password=$_POST['password'];
- $name=$_POST['name'];
- $address=$_POST['address'];
- $country=$_POST['country'];
- $zip=$_POST['zip'];
- $phone=$_POST['phone'];
- $phone=$_POST['email'];
- mysql_connect(localhost,$username,$password);
- @mysql_select_db($database) or die( "Unable to select database");
- $query = "INSERT INTO test_table (username, password, name, address, country, zip, phone, email)
- VALUES ('$username','$password','$name','$address','$country','$zip','$phone','$email')";
- mysql_query($query);
- echo $username";
- echo $password";
- mysql_close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement