Jump to content
Larry Ullman's Book Forums

Registration Form - To Add Phone#


Recommended Posts

Hi,

I want to add phone# info in registration form. But after clicking submit button, both phone# and the message (Please enter your phone number!) exist.

 

My Q is how to remove the sticky message?

 

Here is the code in register.php:

// Check for phone#:

if (preg_match ('/^[A-Z0-9]{2,30}$/i', $_POST['phone'])) {

$u = mysqli_real_escape_string ($dbc, $_POST['phone']);

} else {

$reg_errors['phone'] = 'Please enter your phone number!';

}

 

 

And the code for form in register.php:

<form action="contact.php" method="post" accept-charset="utf-8" style="padding-left:100px">

 

<p><label for="phone"><strong>Phone Number</strong></label><br /><?php create_form_input('phone', 'text', $reg_errors); ?></p>

</form>

 

I don't make any change in form_functions.inc.php.

 

Thanks for your kind help.

 

xampp 1.7.3

php5.3.1

mysql 5.1.41

php<MyAdmin 3.2.4

Win7

editor: DW

Link to comment
Share on other sites

 Share

×
×
  • Create New...