PDA

View Full Version : Script Assisance



jabird60
07-18-2007, 03:14 AM
<?php
// Receiving variables
@$Name = addslashes($_POST['Name']);
@$Email = addslashes($_POST['Email']);
@$username = addslashes($_POST['usernamel']);
@$password = addslashes($_POST['password']);
// Validation
if (strlen($Name) == 0 )
{
header("Location: name_error.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
{
header("Location: email_error.html");
exit;
if (strlen($password) == 0 )
}
header("Location: error_password.html");
exit;
if (strlen($username) == 0 )
{
header("Location: error_username.html");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Order";
$pfw_email_to = "jabird60********.com";
$pfw_message = "Name: $Name\n"
. "Email: $Email\n"
. "Descrption: $Descrption\n";
. "password: $password\n";
. "username: $username\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: orderconf.html");


can anybody see if there is something wong with that script,it says that there is a error on line 18 but i cant figer it out

Watdaflip
07-18-2007, 06:14 AM
These lines

if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
{
header("Location: email_error.html");
exit;
if (strlen($password) == 0 )
}
header("Location: error_password.html");
exit;

should be

if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
{
header("Location: email_error.html");
exit;
}
if (strlen($password) == 0 )
{
header("Location: error_password.html");
exit;
}

VodaHost
07-18-2007, 07:36 AM
Moving to script forum.