Практикую немного пхп.
Естьб простая форма, которая должна отослать введеные данные на мейл.
Но все время выдает ошибку типа
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in C:\internet\localhost\www\02\phpform\use\FromSiteZakaz\process.php on line 35
Помогите пожалуйста понять где ошибка. Форма генерирована скриптом, который раньше нормально работал!
Code:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Vektorizacia');
pt_register('POST','2DChertej');
pt_register('POST','3DChertej');
pt_register('POST','Drugoe');
pt_register('POST','FIO');
pt_register('POST','Address');
pt_register('POST','Phone');
pt_register('POST','Email');
$Attach=$HTTP_POST_FILES['Attach'];
pt_register('POST','Oplata');
if($FIO=="" || $Email=="" || $Oplata=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($HTTP_POST_FILES['Attach']['tmp_name']==""){ }
else if(!is_uploaded_file($HTTP_POST_FILES['Attach']['tmp_name'])){
$error.="<li>The file, ".$HTTP_POST_FILES['Attach']['name'].", was not uploaded!";
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$HTTP_POST_FILES['Attach']['name'];
$image_list[8] = $image_part;
copy($HTTP_POST_FILES['Attach']['tmp_name'], "files/".$image_part);
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Vektorizacia: ".$Vektorizacia."
2DChertej: ".$2DChertej."
3DChertej: ".$3DChertej."
Drugoe: ".$Drugoe."
FIO: ".$FIO."
Address: ".$Address."
Phone: ".$Phone."
Email: ".$Email."
Attach: "$.where_form_is."files/".$image_list[8]."
Oplata: ".$Oplata."
";
$message = stripslashes($message);
mail("info@*****","Form Submitted at your website",$message,"From: phpFormGenerator");
header("Refresh: 0;url=http://www.*****/thanks.html");
?><?php
}
?>
Файл global.inc.php
Code:
<?php
function pt_register()
{
$num_args = func_num_args();
$vars = array();
if ($num_args >= 2) {
$method = strtoupper(func_get_arg(0));
if (($method != 'SESSION') && ($method != 'GET') && ($method != 'POST') && ($method != 'SERVER') && ($method != 'COOKIE') && ($method != 'ENV')) {
die('The first argument of pt_register must be one of the following: GET, POST, SESSION, SERVER, COOKIE, or ENV');
}
$varname = "HTTP_{$method}_VARS";
global ${$varname};
for ($i = 1; $i < $num_args; $i++) {
$parameter = func_get_arg($i);
if (isset(${$varname}[$parameter])) {
global $$parameter;
$$parameter = ${$varname}[$parameter];
}
}
} else {
die('You must specify at least two arguments');
}
}
?>
СПАСИБО огромное заранее!