ricferr Posted January 29, 2010 Share Posted January 29, 2010 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 https://forums.phpfreaks.com/topic/190230-problem-with-php-server-update-from-mid-2009/ Share on other sites More sharing options...
citricsquid Posted January 29, 2010 Share Posted January 29, 2010 Your problem is that your old server had global variables enabled (which is bad) and your new doesn't. How is $menusel defined? From $_GET? if so: $menusel = $_GET['menusel']; at the top of your page. Link to comment https://forums.phpfreaks.com/topic/190230-problem-with-php-server-update-from-mid-2009/#findComment-1003677 Share on other sites More sharing options...
ricferr Posted February 11, 2010 Author Share Posted February 11, 2010 Hi, I haven't tried your solution yet but you're probably right. Just wanted to thank you for the hint regards RF Link to comment https://forums.phpfreaks.com/topic/190230-problem-with-php-server-update-from-mid-2009/#findComment-1010973 Share on other sites More sharing options...
ricferr Posted February 26, 2010 Author Share Posted February 26, 2010 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("[email protected]" . "," . $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("[email protected]" . "," . $_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 https://forums.phpfreaks.com/topic/190230-problem-with-php-server-update-from-mid-2009/#findComment-1018459 Share on other sites More sharing options...
ricferr Posted February 26, 2010 Author Share Posted February 26, 2010 I forgot to add that the file is being properly uploaded but the sending of the mail fails. thanks RF Link to comment https://forums.phpfreaks.com/topic/190230-problem-with-php-server-update-from-mid-2009/#findComment-1018462 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.