Hello

I've recently upgraded my webside php from php4 to php 5.4.
SInce that, my contact page doesn't work anymore
Can someone help me please ?
Here is the code :

<?php
$name=$HTTP_POST_VARS['name'];
$surname=$HTTP_POST_VARS['surname'];
$mail=$HTTP_POST_VARS['mail'];
$object=$HTTP_POST_VARS['object'];
$type=$HTTP_POST_VARS['type'];
$message= Stripslashes($HTTP_POST_VARS['message']);

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/HTML; charset=iso-8859-1\r\n";
$headers .= "From: $name $surname<$mail>\r\nReply-to : $nom <$mail>\nX-Mailer😛HP";

$subject="$object";
$destinataire="efranckson@gmail.com";
$body="<p>Sender : ".$name." ".$surname."</p><p>E-mail : ".$mail."</p><p>subject : ".$object." - ".$type."</p><p>Message : <br>".$message;

Message send !
?></p>

    This code could not have worked in PHP 4. Presumably it was supposed to send an email, but there is no code for doing so (which is perhaps a relief, since there are significant security flaws). Between that and a lack of information about symptoms, I can only give general pointers.

    There have been a lot of changes since PHP 4. There have been a lot of changes since PHP 5, which is only receiving security fixes and will no longer be supported from next year. So if you're upgrading you might as well upgrade to PHP 7.2.

    So you've got a lot of catching up to do.

    $HTTP_POST_VARS is deprecated (replaced in PHP 4.1 by $_POST). stripslashes serves no purpose here (read up on what it's for). And apart from some string concatenations, that's all there is to see here.

    http://www.php.net/migration5.php
    http://www.php.net/migration51.php
    http://www.php.net/migration52.php
    http://www.php.net/migration53.php
    http://www.php.net/migration54.php

      Write a Reply...