Jump to content

problem with php server update from mid 2009


ricferr

Recommended Posts

Hi,

 

I have this navigation menu on 2 websites which used to work just fine. After a recent update to the php server, the menu stopped working properly. It still loads the pages but the highlighted option doesn't change. One of the websites is this one: http://www.lisbonflats.com

 

Any suggestions?

 

  <tr class="menubar">
    <td>
      <?php
				if ($menusel<=1)
				{
				 ?>
      <font color="#ffffff">home ></font>
      <? } else { ?>
      <a href="main01.php?menusel=1" target="main">home    </a>
      <? } ?>
    </td>
  </tr>
  <tr class="menubar">
    <td>
      <?
				if ($menusel==2)
				{
				 ?>
      <font color="#ffffff">local ></font>
      <? } else { ?>
      <a href="main02.php?menusel=2" target="main">local    </a>
      <? } ?>
    </td>
  </tr>

 

Thanks in advance

 

regards

 

RF

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi,

 

I'm having a similar problem with another script. It's a form to which should allow to send an attachment. The file is being uploaded but the mail is not sent. I implemented your correction in this script but I'm missing something.

 

Anyone has any suggestions?

 

thanks

 

Regards

 

RF

 

<?php

function mail_attach($para, $de, $assunto, $mensagem, $ficheiro) {

   $mime_boundary = "<<<:" . md5(uniqid(mt_rand(), 1));
   $data = chunk_split(base64_encode(implode("", file($ficheiro))));
   $header = "From: ".$de."\r\n";
   $header.= "To: ".$para."\r\n";
   $header.= "MIME-Version: 1.0\r\n";
   $header.= "Content-Type: multipart/mixed;\r\n";
   $header.= " boundary=\"".$mime_boundary."\"\r\n";
   
   $content = "This is a multi-part message in MIME format.\r\n\r\n";
   $content.= "--".$mime_boundary."\r\n";
   $content.= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
   $content.= "Content-Transfer-Encoding: 7bit\r\n\r\n";
   $content.= $mensagem."\r\n";
   $content.= "--".$mime_boundary."\r\n";
   $content.= "Content-Disposition: attachment;\r\n";
   $content.= "Content-Type: Application/Octet-Stream; name=\"".$ficheiro."\"\r\n";
   $content.= "Content-Transfer-Encoding: base64\r\n\r\n";
   $content.= $data."\r\n";
   $content.= "--" . $mime_boundary . "\r\n";
   if(mail($para, $de, $assunto, $content, $header)) {
       return TRUE;
   }
   return FALSE;
}

if($_FILES['userfile'] != "") {

//Se houver anexo

$data = $_FILES['userfile']['name'];

$data2 = $_FILES['userfile']['tmp_name'];

copy($data2, $data)
or die ("Houve um erro na cópia do ficheiro, o envio da mensagem será abortado.");

//mail_attach ("destinatário", nome e e-mail do utilizador, "assunto", texto da mensagem, ficheiro anexo);

$name_field = $_POST['nome'];
$email_field = $_POST['email'];
$mensagem = $_POST['nifrec'];

$body = "DADOS DO PARTICIPANTE\r\n";
$body .= "\r\n nome: " . $_POST['nome'];
$body .= "\r\n afiliação: " . $_POST['afilicao'];
$body .= "\r\n departamento: " . $_POST['departamento'];
$body .= "\r\n morada: " . $_POST['morada'];
$body .= "\r\n código postal: " . $_POST['codpost1'] . " - " . $_POST['codpost2'] . " " . $_POST['localidade'] ;
$body .= "\r\n telefone: " . $_POST['telefone'] . " - " . "fax: " . $_POST['fax'] ;
$body .= "\r\n e-mail: " . $_POST['email'];
$body .= "\r\n\r\n dias seleccionados: " . $_POST['allitems'];
$body .= "\r\n valor total: " . $_POST['answer'] . " Euros";
$body .= "\r\n \r\n \r\n DADOS PARA EMISSÃO DE RECIBO \r\n ";
$body .= "\r\n nome/ entidade: " . $_POST['nomerec'];
$body .= "\r\n morada: " . $_POST['moradarec'];
$body .= "\r\n código postal: " . $_POST['codpost1rec'] . " - " . $_POST['codpost2rec'] . " " . $_POST['localidaderec'] ;
$body .= "\r\n NIF: " . $_POST['nifrec'];

mail_attach("ricardo.ferreira@pointoview.net" . "," . $email_field, $name_field . "<" . $email_field . ">", $assunto . " (via attach script)", $body, $data)
or die ("O envio dos seus dados falhou! (via attach script)");

header("location: obrigado.html");

unlink ($data);

} else {

//Se não houver anexo

//mail ("destinatário", "assunto", texto da mensagem, nome e e-mail do utilizador);

$name_field = $_POST['nome'];
$email_field = $_POST['email'];
$assunto = "Inscrição de: " . $_POST['nome'];

$body = "DADOS DO PARTICIPANTE\r\n";
$body .= "\r\n nome: " . $_POST['nome'];
$body .= "\r\n afiliação: " . $_POST['afilicao'];
$body .= "\r\n departamento: " . $_POST['departamento'];
$body .= "\r\n morada: " . $_POST['morada'];
$body .= "\r\n código postal: " . $_POST['codpost1'] . " - " . $_POST['codpost2'] . " " . $_POST['localidade'] ;
$body .= "\r\n telefone: " . $_POST['telefone'] . " - " . "fax: " . $_POST['fax'] ;
$body .= "\r\n e-mail: " . $_POST['email'];
$body .= "\r\n\r\n dias seleccionados: " . $_POST['allitems'];
$body .= "\r\n valor total: " . $_POST['answer'] . " Euros";
$body .= "\r\n \r\n \r\n DADOS PARA EMISSÃO DE RECIBO \r\n ";
$body .= "\r\n nome/ entidade: " . $_POST['nomerec'];
$body .= "\r\n morada: " . $_POST['moradarec'];
$body .= "\r\n código postal: " . $_POST['codpost1rec'] . " - " . $_POST['codpost2rec'] . " " . $_POST['localidaderec'] ;
$body .= "\r\n NIF: " . $_POST['nifrec'];

mail("ricardo.ferreira@pointoview.net" . "," . $_POST['email'], $assunto . " (via no attach script)", $body, "From:\"" . $name_field ."\"<" . $email_field . ">\n") or
die ("O envio dos seus dados falhou! (via no attach script)");

header("location: obrigado.html");

}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.