AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters > Web Development
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Web Development Java/PHP/Perl/ASP and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Nov 25, 2007, 14:40   #1
MediaGate LLC
 
Vazgen Abgaryan's Avatar
 
Join Date: Oct 2001
Location: At home :)
Posts: 580
Rep Power: 7
Reputation: 18
Send a message via ICQ to Vazgen Abgaryan
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
Vazgen Abgaryan is offline   Reply With Quote Quote selected
Old Nov 25, 2007, 14:55   #2
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: Yerevan, Armenia
Posts: 7,090
Blog Entries: 15
Rep Power: 10
Reputation: 255
PHP Code:
$imgtmp 'files/ ' $image_list[8];
$message="Vektorizacia: $Vektorizacia
2DChertej: $2DChertej
3DChertej: $3DChertej
Drugoe: $Drugoe
FIO: $FIO
Address: $Address
Phone: $Phone
Email: $Email
Attach: $where_form_is $imgtmp
Oplata: $Oplata
"

__________________
Chat with acid


acid is offline   Reply With Quote Quote selected
Old Nov 25, 2007, 15:34   #3
MediaGate LLC
 
Vazgen Abgaryan's Avatar
 
Join Date: Oct 2001
Location: At home :)
Posts: 580
Rep Power: 7
Reputation: 18
Send a message via ICQ to Vazgen Abgaryan
Спасибо, щас попробую
__________________
http://www.am.am
Vazgen Abgaryan is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT. The time now is 13:28.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link