Jump to content

[SOLVED] no idea where the problem is


NickG21

Recommended Posts

hey everyone, this code has been working fine for me all day and i just added another variable to validate and now i get this error:

Parse error: parse error, unexpected '>' in .../ContactUs.php on line 75
Line 75 is the line that echoes whatever was stored in the $error[] array.

any idea what is going on with this?? thank you

[code]<?php
function checkEmail($email)
{
  if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))
  {
      return FALSE;
  }
  list($Username, $Domain) = split("@",$email);
  if(getmxrr($Domain, $MXHost))
  {
      return TRUE;
  }
  else
  {
      if(@fsockopen($Domain, 25, $errno, $errstr, 15))
      {
        return TRUE;
      }
      else
      {
        return FALSE;
      }
  }
}
function redirect($filename=".?op=main",$delay="0",$die="0"){
if((!headers_sent())&&($delay=="0")) header('Location: '.$filename);
elseif($delay=="0"){
  echo '<script type="text/javascript">';
  echo 'window.location.href="'.$filename.'";';
  echo '</script>';
  echo '<noscript>';
  echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />';
  echo '<noscript>';
}else echo '<meta http-equiv="refresh" content="'.$delay.';url='.$filename.'" />';
if($die=="0") exit;
}
if (isset($_POST['submit'])) {
$company = $_POST['CompanyName'];
$name = $_POST['YourName'];
$email = $_POST['YourEmailAddress'];
$domainName = $_POST['ListOrDomainName'];
$username = $_POST['Username'];
$password = $_POST['Password'];
$credit = $_POST['CreditCardNumber];
$error = array();

if (empty($company))
{
$error[] = "Comapny";
}
if (empty($name))
{
$error[] = "Your Name";
}
elseif (!preg_match("/^([a-zA-Z])+/",$name))
{
  $error[] = "Your Name";
  $name="";
}

if(checkEmail($email) == FALSE)
{
  $error[]="E-Mail Address";
  $email = "";
}
if(empty($username))
{
$error[] = "User Name";
}
if(empty($password))
{
$error[]="Password";
}
elseif (strlen($password) < 6)
{
$error[]= "Password Must Contain At Least Six Characters";
}
if(empty($credit)){
$error[]="Credit Card Number";
}
elseif(!preg_match("/^([0-9])+/",$credit))
{
$error[] = "Invalid Credit Card Number";
}

if(count($error) > 0) {
    echo "<big><b>The Following Errors Were Found, Please Re-Enter:</b></big><br/>". implode('<br/>', $error). "</p>";
    } else {
header('Location: ./Thanks.php');
    exit;
  }
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/32084-solved-no-idea-where-the-problem-is/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.