Code: Select all
if (preg_match("/^[-]/",$type)
{
echo '<h3>Please Choose a TYPE.</h3>';
} is there something i need to do so that this will work on wamp
Moderator: General Moderators
Code: Select all
if (preg_match("/^[-]/",$type)
{
echo '<h3>Please Choose a TYPE.</h3>';
} WHERE???jackpf wrote:You're missing a bracket.
even after adding the ) is still dont workjackpf wrote:Line 1.
Please enter your Phone number
"); } else { if(preg_match("/^\(\+[0-9]{3}\) [0-9]{3} [0-9]{6}$/" , $test)) { echo "
Valid Number
"; } else { echo "
Invaild phone number
"; die("Please enter your Phone number in the following form (+555) 555 555555"); } } } else { ?>
Phone:______________
look im sure its not an error (my university Web doctor gave it to me)because is works fine on appserv but not on wamp witch im more comfortable usingjackpf wrote:Can you not post your entire code?
Turn on error reporting as well. That should show you where the error is.
Code: Select all
<html>
<body>
<?
if($_REQUEST["hide"]==1)
{
$test=$_REQUEST["phone"];
if($test == "")
{
die("<p style='color:#2baa55;font-size:20pt'>Please enter your Phone number</p>");
}
else
{
if(preg_match("/^\(\+[0-9]{3}\) [0-9]{3} [0-9]{6}$/" , $test))
{
echo "<p style='color:#2baa55;font-size:20pt'>Valid Number</p>";
}
else
{
echo "<p style='color:red'>Invaild phone number</p>";
die("Please enter your Phone number in the following form (+555) 555 555555");
}
}
}
else
{
?>
<form method="post">
<input name="hide" type="hidden" value="1">
Phone:<input name="phone" type="text">
<input type="Submit" value="Send">
</form>
<?
}
?>
</body>
</html>