Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to validate phone number in php procedural programming

if((preg_match("/[^0-9]/", '', $str)) && strlen($str) == 10)
{
echo "Invalid phone number
}
Comment

how to validate phone number in php procedural programming

<?php
if(isset($_POST['submit'])) {
//include validation class
//assign post data to variables
$name = trim($_POST['name']); // Storing username
$email = trim($_POST['email']); // Storing email address
$number= trim($_POST['number']); // storing the phone number
}
?>
Comment

how to validate phone number in php procedural programming

<html>
<head>
<title>Validation Form</title>
</head>
<body>
<form id="contact_form" method="post" action="."> <br />
Label <input type="text" name="name" class="textfield" value="" /> <br />
Email <input type="text" name="email" class="textfield" value="" /> <br />
Phone Number <input type="text" name="number" class="textfield" value="" /> <br />
<p><input type="submit" name="submit" class="button" value="Submit" /></p>
</form>
</body>
</html>
Comment

how to validate phone number in php procedural programming

<?php
$reg = '/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/';
if (preg_match($reg, $email)) {
echo $email . " Email Id is accepted.";
} else {
echo $email . "Invalid Email ID.";
}
?>
Comment

how to validate phone number in php procedural programming

if(strlen($name) >=5 && strlen($name)<=10)
Comment

how to validate phone number in php procedural programming

if (preg_match("/^[a-z0-9_]+$/i", $name) )
{
return true;
}
else
{
echo "Enter valid username"
}
Comment

how to validate phone number in php procedural programming

if(empty($name) && empty($number) && empty($email))
{
echo "All fields are compulsory"
}
Comment

how to validate phone number in php procedural programming

<?php
echo '<p>Hello I am PHP</p>';
?>
Comment

PREVIOUS NEXT
Code Example
Php :: db($twoRandomPhotosOfSomePeoples); 
Java :: import collectors java 
Java :: android manifest cleartext traffic permitted 
Java :: print map java 
Java :: how to change font size in JLabel 
Java :: how to get all the names of the files in a folder in java? 
Java :: java list string package import 
Java :: copy to clipboard java 
Java :: convert input stream to string java 
Java :: spigot custom join message 
Java :: junit 5 dependency maven 
Java :: fullscreen activity android 
Java :: spring boot security maven 
Java :: creating random color in java 
Java :: java time code 
Java :: how to validate email java 
Java :: float to string java 
Java :: Failed to resolve org.junit.platform:junit-platform-launcher:1.7.0 
Java :: import android.support.v4.media.app.NotificationCompat.MediaStyle; 
Java :: format localdatetime 
Java :: how to delete last char in string java 
Java :: java double to string with comma 
Java :: printwriter java append to file 
Java :: Duplicate class android.support.v4.app. 
Java :: mostrar todos los elementos de un arraylist java 
Java :: finally block does not complete normallyJava(536871096) 
Java :: void set method using collections 
Java :: spigot heal player 
Java :: how to set view width programmatically in android 
Java :: java swing get resource from image 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =