Re: Re[2]: [PHP] Newbie seeks urgent help

From: Date: Sat, 14 Jul 2007 01:09:05 +0000
Subject: Re: Re[2]: [PHP] Newbie seeks urgent help
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-258831@lists.php.net to get a copy of this message
On 7/14/07, Luc <luc@lavabit.com> wrote:
Hello Daniel, Friday, July 13, 2007, 5:50:53 PM, you wrote:
    In your code, all you have is this:
Unfortunately it doesn't work, probably because of my lack of php skills :-) I copied and paste your solution as follows: <? // Your email address $youremail = 'mail adres'; // Your web site title $websitetitle = 'John Doe's Site';
You're using a ' here, which ends the string. Use one of these: $websitetitle = "John Doe's Site"; OR $websitetitle = 'John Doe\'s Site'; Just a matter of preference ;)
// Path to "thanks for the message" page $thankyoupage = '................./Contact_success1.php'; // Send notification to sender (use false if not required) $sendnotification = true; $subjectline = "Orçamento de empresa"; $body =<<<EOB Empresa: $_POST['empresa_name'] Contato: $_POST['contato_name'] Fone: $_POST['fone'] Fax: $_POST['fax'] Email: $_POST['email'] Produto: $_POST['produto'] Origem: $_POST['origem'] Destino: $_POST['destino'] Quantidade: $_POST['quantidade'] Peso: $_POST['peso'] Comprimento: $_POST['comprimento'] Altura: $_POST['altura'] Largura: $_POST['largura'] EOB; $from = "me@anotherdomain.com"; $headers = "From: ".$from."\r\n"; $headers .= "X-Mailer: Dan Brown, pilotpig.net\r\n"; mail($youremail,$subjectline,$body,$headers); // Continue with your error checking, output of form, et cetera. $contact_form_action = $_SERVER['PHP_SELF']; if ((isset($_POST["sendcontact"])) && ($_POST["sendcontact"] == "contactsent")) {
       $contacter_form_error = array();
       if (empty($_POST['empresa_name'])){
               $contacter_form_error[] = 'favor preencher nome da empresa';
       }
       if (empty($_POST['contato_name'])){
               $contacter_form_error[] = 'favor preencher nome do contato';
       }
       if (empty($_POST['fone'])){
               $contacter_form_error[] = 'favor preencher número do telefone';
       }
       if (empty($_POST['contato_email'])){
               $contacter_form_error[] = 'favor preencher seu e-mail';
       }
       if (empty($_POST['produto'])){
               $contacter_form_error[] = 'favor preencher o produto';
       }
       if (empty($_POST['origem'])){
               $contacter_form_error[] = 'favor preencher origem';
       }
       if (empty($_POST['destino'])){
               $contacter_form_error[] = 'favor preencher destino';
       }
       if (empty($_POST['quantidade'])){
               $contacter_form_error[] = 'favor preencher quantidade';
       }
       if (empty($_POST['peso'])){
               $contacter_form_error[] = 'favor preencher peso';
       }
       if (empty($_POST['comprimento'])){
               $contacter_form_error[] = 'favor preencher comprimento';
       }
       if (empty($_POST['altura'])){
               $contacter_form_error[] = 'favor preencher altura';
       }
       if (empty($_POST['largura'])){
               $contacter_form_error[] = 'favor preencher largura';
       }
       else {
               $empresa_name = stripslashes($_POST['empresa_name']);
               $contato_email = stripslashes($_POST['contato_email']);
               $subjectline = "$websitetitle | Mensagem de $empresa_name";
               if($sendnotification == true) {
                       $notification_message = "Obrigado por nos contatar, $contato_name. Recebemos sua mensagem e entraremos em contato em breve";
                       $notification_subject = "Obrigado por sua mensagem para $websitetitle.";
                       mail($contato_email, $notification_subject, $notification_message, "From: $youremail");
               }
               header("Location:$thankyoupage");
       }
} ?> which gives the following error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /................ on line 14 -- Best regards, Luc
It's defenitely not line 14, but you probably snipped some stuff out of it ;) Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

« previous php.general (#258831) next »