I have the following code. I wanted to determine if the value inputted in $cellno (from a textbox) are all digits (numbers), and if it's 11 numbers, and if its starting numbers are "09".
One correct value example is 09345678910. It is all numbers, has 11 digits, and begins in 09.
By the way, I got this error upon executing my code:
Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\GWS\cusdet.php on line 26
Please help!!! Super, super, duper newbie here. :( Thanks in advance!!
<input id="cellno" type="text" placeholder = "Enter Cellphone Number" size = "20">
<?php
$cellno = document.getElementById('cellno').value;
$corcellno = 09;
?>
<input type="submit" name="Submit" value=" Next " onClick="
<?php
echo "if (strcasecmp($cellno, $corcellno, 2) == 0){";
echo "if (strlen($cellno == 11) && preg_match("/[0-9]/", $cellno)";
echo "window.location.href='dismet.php';}";
echo "else";
echo "alert('Sorry. You must input a valid cellphone number that contains 11 digits.');}";
?>">