can someone help me with my php code?

Gregory

New member
I am getting this error:

Parse error: parse error in C:\wamp\www\ValidateCreditCard.php on line 32

can someone pls tell me why?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Validate Credit Card</title>
<html>
<head>
</head>
<body>
<?php
if (!isset($_GET['ccnumber']))
echo "<p>Enter your credit card number.</p>";
else{
$Payment = $_GET['ccnumber'];
$ValidPayment = str_replace("-", "", $Payment);
$ValidPayment = str_replace(" ", "", $ValidPayment);
if (is_numeric($ValidPayment))
echo "<p>You did not enter a valid credit card number!</p>";
else
echo "<p>Your credit card number is $ValidPayment.</p>";
?>

<h1>Validate Credit Card</h1><hr />

<form action="ValidateCreditCard.php" method="get" enctype="application/x-www-form-urlencoded">
<p><input type="text" name="ccnumber" size="20" value="php if (!empty($_GET['ccnumber'])) echo $_GET['ccnumber'] ?>" />
</p>
<p><input type="submit" value="Validate Credit Card" />
</form><hr />
<hr />
</body>
</html>
the code does say url-encoded"> I don't know why it cut it off here...
thanks Gathos but I looked in my class book there is definitely no { anywhere in the php code.
you are right sorry I did need some { but now nothing happens except the text that i didn't enter a correct cc number


<body>
<?php
if (!isset($_GET['ccnumber']))
echo "<p>Enter your credit card number.</p>";
else {
$Payment = $_GET['ccnumber'];
$ValidPayment = str_replace("-", "", $Payment);
$ValidPayment = str_replace(" ", "", $ValidPayment);
if (is_numeric($ValidPayment))
echo "<p>You did not enter a valid credit card number!</p>";
else
echo "<p>Your credit card number is $ValidPayment.</p>";
}
?>

<h1>Validate Credit Card</h1><hr />

<form action="ValidateCreditCard.php" method="get" enctype="application/x-www-form-urlencoded">
<p><input type="text" name="ccnumber" size="20" value="<?php if (!empty($_GET['ccnumber'])) echo $_GET['ccnumber'] ?>" />
</p>
...
 
Back
Top