Have you created account and got email with login details, this will be used on next part of the script.
Have you created account and got email with login details, this will be used on next part of the script.
Become PHP Expert in 30 days
FreeMarriage.com - Free Online Matrimonial
FlashWebHost.com - Professional Web Hosting, Designing.
Yes, i got mail with login details.
http://php.flashwebhost.com/stefin/signup.html
I received the account creation mail.
Code:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>User Account SIGN UP</title> </head> <body> <h1>USER SIGN UP</h1> <form action="signup.php" method="POST"> Name <br> <input type="text" name="name" required> <br> Email <br> <input type="email" name="email" required> <br> Password <br> <input type="text" name="password" required> <br> <br> <button type="submit" name="submit" value="submit">SIGN UP</button> </form> </body> </html>Code:<?php if (isset($_POST['submit'])) { echo '<p>Server got following data through POST method.</p>'; echo '<pre>'; print_r($_POST); echo '</pre>'; $name = $_POST['name']; $email = $_POST['email']; $password = $_POST['password']; $db_server = '127.0.0.1'; $db_user = 'fwhphp_user'; $db_password = 'k5BJRaX6SFbs'; $db_name = 'fwhphp_db'; $mysqli = new mysqli($db_server, $db_user, $db_password, $db_name); if ($mysqli->connect_errno) { echo 'Connect failed: ' . $mysqli->connect_error; exit(); } $sql = "INSERT INTO `users` SET `name`='" . $name . "', `email`='" . $email . "', `password`='" . $password . "'"; if ($mysqli->query($sql) === TRUE) { echo '<h1>User Account Created. Welcome mail sent to ' . $email . '</h1>'; $mailMessage = " Hello $name, Your account created. Email: $email Password: $password Please keep this password secure as we will need it for coming days. "; mail($_POST['email'], 'Your account created', $mailMessage, "From: [email protected]\n\r"); } else { echo '<h1>Failed to create user account</h1>'; echo $mysqli->error; } } else { die('I got no data with POST method, have some ?'); }
http://php.flashwebhost.com/sherly/signup.html
Code:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>User Account Creation</title> </head> <body> <h1>Account Creation Form</h1> <form action="signup.php" method="POST"> Name <br> <input type="text" name="name" required> <br> Email <br> <input type="email" name="email" required> <br> Password <br> <input type="text" name="password" required> <br> <br> <button type="submit" name="submit" value="submit">Create Account</button> </form> </body> </html>Code:<?php if (isset($_POST['submit'])) { echo '<p>Server got following data through POST method.</p>'; echo '<pre>'; print_r($_POST); echo '</pre>'; // lets read data from $_POST $name = $_POST['name']; $email = $_POST['email']; $password = $_POST['password']; // Connect to MYSQL Server $db_server = '127.0.0.1'; $db_user = 'fwhphp_user'; $db_password = 'k5BJRaX6SFbs'; $db_name = 'fwhphp_db'; $mysqli = new mysqli($db_server, $db_user, $db_password, $db_name); if ($mysqli->connect_errno) { echo 'Connect failed: ' . $mysqli->connect_error; exit(); } // Lets save user submitted information to database. $sql = "INSERT INTO `users` SET `name`='" . $name . "', `email`='" . $email . "', `password`='" . $password . "'"; if ($mysqli->query($sql) === TRUE) { echo '<h1>User Account Created. Welcome mail sent to ' . $email . '</h1>'; // lets send a welcome mail to user. // With name, email address and password. $mailMessage = " Hello $name, Your account created. Email: $email Password: $password Please keep this password secure as we will need it for coming days. "; mail($_POST['email'], 'Your account created', $mailMessage, "From: [email protected]\n\r"); } else { echo '<h1>Failed to create user account</h1>'; echo $mysqli->error; } } else { die('I got no data with POST method, have some ?'); }
DAY 15 PHP PROGRAMMING
http://php.flashwebhost.com/tom/signup.html
PHP Code:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>User Account Sign Up</title>
</head>
<body>
<h1>Sign Up Form</h1>
<form action="signup.php" method="POST">
Name
<input type="text" name="name" required>
<br>
<input type="email" name="email" required>
<br>
Password
<input type="text" name="password" required>
<br>
<br>
<button type="submit" name="submit" value="submit">Create Account</button>
</form>
</body>
</html>
PHP Code:
<?php
if (isset($_POST['submit'])) {
echo ' Server got following data through POST method.';
echo '<pre>';
print_r($_POST);
echo '</pre>';
$name = $_POST['name'];$email = $_POST['email'];$password = $_POST['password'];
$db_server = '127.0.0.1';$db_user = 'fwhphp_user';$db_password = 'k5BJRaX6SFbs';$db_name = 'fwhphp_db';
$mysqli = new mysqli($db_server, $db_user, $db_password, $db_name);
if ($mysqli->connect_errno) {
echo 'Connect failed: ' . $mysqli->connect_error;
exit();
}
$sql = "INSERT INTO `users` SET `name` = '" . $name . "' , `email` = '" . $email . "' , `password` = '" . $password . "'";
if ($mysqli->query($sql) === TRUE) {echo '<h1> Account Created. Welcome Mail sent to ' . $email . '</h1>';
$mailMessage = "
Hello $name,
YOUR ACCOUNT CREATED.
Email: $emailPassword: $password
Please keep this password secure as we will need it for coming days.";
mail($_POST['email'], 'Your Account Created', $mailMessage, "From: [email protected]\n\r");
} else {
echo '<h1>Failed to create user account</h1>';echo $mysqli->error;
}
} else {
die('I got no data with POST method, have some ?');
}
Last edited by image; 08-27-2014 at 06:41 AM.
Bookmarks