Search the Community
Showing results for tags 'databases'.
-
Hello, Is it possible to have two form submissions on one page? I would lke my user to be able to delete or edit their record on the same page. So far my code almost works however, I am now wondering if I am trying to do something that can't be done. The user accesses their record from a list on another page. Then the information is passed through an id in a URL to a page where the record is displayed in full. Thanks, Marie
-
My registration form will not accept any name with a space, hyphen or apostrophe, such as O'Meara or Mary-Lou. The form tells me to "Please enter your first name or last name or username - whichever applies. When I take the space, hyphen, or apostrophe out then the form will submit. I am using the code from the Knowledge is Power sight.<?php // Check for a form submission: if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Check for a first name: if (preg_match ('/^[A-Z \'.-]{2,20}$/i', $_POST['first_name'])) { $fn = mysqli_real_escape_string ($connect, $_POST['first_name']); } else { $reg_errors['first_name'] = 'Please enter your first name!'; } // Check for a last name: if (preg_match ('/^[A-Z \'.-]{2,40}$/i', $_POST['last_name'])) { $ln = mysqli_real_escape_string ($connect, $_POST['last_name']); } else { $reg_errors['last_name'] = 'Please enter your last name!'; } // Check for a username: if (preg_match ('/^[A-Z0-9]{2,30}$/i', $_POST['username'])) { $u = mysqli_real_escape_string ($connect, $_POST['username']); } else { $reg_errors['username'] = 'Please enter a desired name!'; } Hoping that someone can shed some light on this problem. Thanks, Marie