Code PHP under version 7

Alles, was PHP betrifft, kann hier besprochen werden.

Code PHP under version 7

Postby juanferaviles » 06. June 2018 18:11

Hi fellows.

I need to know this code how can i make it functional under php7. Also i wish to know if only changing this lines could work or if i need to change more things. Tks.

Code: Select all
<?php
if(isset($_POST['bts'])){
   if($_POST['apellido1']!=null && $_POST['apellido2']!=null && $_POST['nombre1']!=null  && $_POST['nombre2']!=null && $_POST['cc']!=null && $_POST['email']!=null && $_POST['emailCorp']!=null && $_POST['telFijo']!=null && $_POST['telCel']!=null && $_POST['fechaNac']!=null && $_POST['fechaExp']!=null && $_POST['fechaIng']!=null && $_POST['dirRes']!=null && $_POST['nombreBar']!=null && $_POST['notas']!=null){
      $paginas = new Personal();
      $paginas->add();
      
      $apellido1 = $_POST['apellido1'];
      $nombre1 = $_POST['nombre1'];
      $nombre2 = $_POST['nombre2'];
      $cc = $_POST['cc'];
      $email = $_POST['email'];
      $telCel = $_POST['telCel'];

      $header = 'Email del usuario: ' . $email . " \r\n";
      $header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
      $header .= "Mime-Version: 1.0 \r\n";
      $header .= "Content-Type: text/html";
           
      $body= "Usuario Registrado: " . $email . "\r\n";
      $body .= "Nombre: " . $nombre1 . "\r\n";
      $body .= "Apellido: " . $apellido1 . " \r\n" . "\r\n";
      $body .= "\r\n";
      $body .= "Desde: Registro Web M";
      $body .= "\r\n";
           
      $para = "talentohumano@m.com,aux.sgi@m.com,sistemas@m.com";
               
      mail($para, utf8_decode($body), $header);
      ?>
juanferaviles
 
Posts: 8
Joined: 05. June 2018 15:22
XAMPP version: 3.2.2
Operating System: Sercer 2012 R2

Re: Code PHP under version 7

Postby Altrea » 06. June 2018 20:27

Hi,

what makes you think this code does not work with PHP7?
The code is incomplete (open but not closed brackets) but apart from this i don't see any reason this code cannot run with PHP7.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Code PHP under version 7

Postby juanferaviles » 06. June 2018 23:26

Altrea wrote:Hi,

what makes you think this code does not work with PHP7?
The code is incomplete (open but not closed brackets) but apart from this i don't see any reason this code cannot run with PHP7.

best wishes,
Altrea

Tks, well, i think that because i´ve upgraded php to 7 and stop working, dont have changed anything else!
juanferaviles
 
Posts: 8
Joined: 05. June 2018 15:22
XAMPP version: 3.2.2
Operating System: Sercer 2012 R2

Re: Code PHP under version 7

Postby Altrea » 07. June 2018 01:36

Your description is not very detailed.
Which part of your script exactly stopped working?
Are there any error messages present on the screen or the log files?
How did you upgrade to PHP 7 exactly?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Code PHP under version 7

Postby juanferaviles » 07. June 2018 16:04

Altrea wrote:Your description is not very detailed.
Which part of your script exactly stopped working?
Are there any error messages present on the screen or the log files?
How did you upgrade to PHP 7 exactly?


Thank you for answer.
The problem is that email is not being sended.
Well, i´vwe not read the log file, im going to do that now.
Im using xampp and ive upgraded php as their instructions.
I have another web app working and that is working (sending emails very well).
juanferaviles
 
Posts: 8
Joined: 05. June 2018 15:22
XAMPP version: 3.2.2
Operating System: Sercer 2012 R2

Re: Code PHP under version 7

Postby juanferaviles » 07. June 2018 16:51

Resolved!
Log file says: "18/06/07 10:34:32 : Message is missing sender's address"

Search sendmail.ini and add line:
"force_sender=sistemas@m.com"

Tks for your help.
juanferaviles
 
Posts: 8
Joined: 05. June 2018 15:22
XAMPP version: 3.2.2
Operating System: Sercer 2012 R2


Return to PHP

Who is online

Users browsing this forum: No registered users and 11 guests