![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Web Development Java/PHP/Perl/ASP and more |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| MediaGate LLC | Simple CODE, please help! Практикую немного пхп. Естьб простая форма, которая должна отослать введеные данные на мейл. Но все время выдает ошибку типа Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in C:\internet\localhost\www\02\phpform\use\FromSiteZ akaz\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');
}
}
?>
__________________ http://www.am.am |
| | |
| | #2 |
| Administrator Join Date: Sep 2001 Location: Yerevan, Armenia
Posts: 7,090
Blog Entries: 15 Rep Power: 10 Reputation:
255 | PHP Code: |
| | |
| | #3 |
| MediaGate LLC | Спасибо, щас попробую
__________________ http://www.am.am |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mark Twain - The Awful German Language | Silver | English Only | 1 | Mar 20, 2006 12:20 |
| Inspiration, imitation or innovation - how do designers create unique identities? | aramx | Web sites | 1 | Jan 16, 2006 13:45 |
| Simple code but does not running | burhankhan | Languages, Compilers and Interpreters | 4 | May 21, 2004 00:07 |
| Essay -The Simple Story | greka | Literary nook | 43 | Aug 26, 2002 18:19 |
| Just a simple Warcraft III artwork... | Jaguar | General | 2 | Aug 3, 2002 07:58 |