Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'input'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. Hey, I am currently reading the book, and have made my own register form and php script. There is no problems with the database connection, but it just will not insert information into the database. The MySQL database is named 'test' and the table 'users'. The table has user_id, first_name, last_name, email, pass and registration_date columns. here is the registration form: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body><link rel="stylesheet" type="text/css" href="style.css"> <form action="script4.php" method="post"> <p>First Name:<input type="text" name="first_name" /></p> <p>Last Name:<input type="text" name="last_name" /></p> <p>Email: <input type="text" name="email" /></p> <p>Password: <input type="password" name="pass1" /></p> <p>Confirm Password: <input type="password" name="pass2" /></p> <input type="submit" name="submit" value="Submit!" /> </form> </body> </html> and here is script4.php : <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php $first_name = $_REQUEST['first_name']; $last_name = $_REQUEST['last_name']; $email = $_REQUEST['email']; $pass1 = $_REQUEST['pass1']; $pass2 = $_REQUEST['pass2']; require ('mysql_connect.php'); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $errors = array();} if (!empty($_POST['first_name'])) { $errors[] = "You forgot to enter your first name!"; } else { $fn = trim($_POST['first_name']); } if (!empty($_POST['last_name'])) { $errors[] = "You forgot to enter your first name!"; } else { $ln = trim($_POST['last_name']); } if (!empty($_POST['email'])) { $errors[] = "You forgot to enter your first name!"; } else { $e = trim($_POST['email']); } if (!empty($_POST['pass1'])) { if ($_POST['pass1'] != $_POST['pass2']) { $errors[] = "Your passwords do not match."; } else { $p = trim($_POST['pass1']);} }else { $errors[] = "You forgot to enter your password."; } if (empty($errors)) { require ('mysql_connect.php'); @mysqli_query("INSERT INTO users (first_name, last_name, email, pass, registration_date) VALUES($first_name, $last_name,$email, SHA1($pass), NOW() )");} ?> </body> </html> Please can someone help me. I am using WAMP server by the way.
  2. On my registration page, I would like to allow my clients to select from two different options as roles they can have when they register for the website. The first role is "member", the second is "manager". I can't find any resources on how the syntax should work with the create_form_input tag to allow the user to select one of those two options and store it in the database under the "type" field. Please help! Jim
×
×
  • Create New...