I want this php to send me a mail with all the text entered on the text entries, but when i click "Submit", it doesnt send any info. Heres the code:

Your apply has been sended successfully, check your mail within 1 day to 7 days to get your answer from the staff team."; header("refresh:5;url=../apply/steamauth/logout.php"); $_POST['username'] = $username; $_POST['steamid'] = $steamid2; $_POST['horarytime'] = $horarytime; $_POST['lua'] = $luaknowledge; $_POST['ulx'] = $ulxknowledge; $_POST['server'] = $anotherservers; $_POST['hoursplayed'] = $hoursplayed; $_POST['warns'] = $warnsurl; $_POST['mic'] = $hasmic; $_POST['online'] = $hoursonlineprovided; $_POST['why'] = $whywantstobefromthestaff; $_POST['rank'] = $actualrank; $_POST['donated'] = $hasdonated; $_POST['age'] = $age; $_POST['email'] = $mail; $to = "noreply@vanityrp.site.nfoservers.com"; $subject = "Vanity Roleplay Staff Application"; $message = " Vanity Roleplay Staff Aplication

Username: ".$username."\n \n \n

SteamID64: ".$steamid2." , transform it to normal SteamID in steamid.io\n \n \n

Horary Time: ".$horarytime."\n \n \n

LUA Knowledge: ".$luaknowledge."\n \n \n

ULX Knowledge: ".$ulxknowledge."\n \n \n

Servers played as admin: ".$anotherservers."\n \n \n

Hours Played IG URL: ".$hoursplayed."\n \n \n

Warns URL: ".$warnsurl."\n \n \n

Has mic: ".$hasmic."\n \n \n

Hours online provided: ".$hoursonlineprovided."\n \n \n

Why wants to be part from the staff team: ".$whywantstobefromthestaff."\n \n \n

Actual rank: ".$actualrank."\n \n \n

Has donated: ".$hasdonated."\n \n \n

Age: ".$age."\n \n \n

PLEASE BE SURE TO MAIL TO '".$mail."' IF HE DID IT OR NOT!

THIS IS AN AUTOMATED MESSAGE, PLEASE DO NOT REPLY!

"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= 'From: noreply@vanityrp.site.nfoservers.com' . "\r\n"; mail($to,$subject,$message,$headers); } ?>

Theres any way to fix it?, as i said, i cant found the fix and im just getting no info on the mail i get from the php file

Roberth

Ответов: 2

Ответы (2)

You are assigning it wrongly.

 $_POST['username']  = $username;

change all of them to

 $username = $_POST['username'];

The values are in POST so get the values from POST, you are doing it the other way.

Here's a working version.

Enjoy:)

 
Your apply has been sended successfully, check your mail within 1 day to 7 days to get your answer from the staff team."; header("refresh:5;url=../apply/steamauth/logout.php"); $username = $_POST['username']; $steamid2 = $_POST['steamid']; $horarytime = $_POST['horarytime']; $luaknowledge = $_POST['lua']; $ulxknowledge = $_POST['ulx']; $anotherservers = $_POST['server']; $hoursplayed = $_POST['hoursplayed']; $warnsurl = $_POST['warns']; $hasmic = $_POST['mic']; $hoursonlineprovided = $_POST['online']; $whywantstobefromthestaff = $_POST['why']; $actualrank = $_POST['rank']; $hasdonated = $_POST['donated']; $age = $_POST['age']; $mail = $_POST['email']; $to = "noreply@vanityrp.site.nfoservers.com"; $subject = "Vanity Roleplay Staff Application"; $message = " Vanity Roleplay Staff Aplication

Username: ".$username."\n \n \n

SteamID64: ".$steamid2." , transform it to normal SteamID in steamid.io\n \n \n

Horary Time: ".$horarytime."\n \n \n

LUA Knowledge: ".$luaknowledge."\n \n \n

ULX Knowledge: ".$ulxknowledge."\n \n \n

Servers played as admin: ".$anotherservers."\n \n \n

Hours Played IG URL: ".$hoursplayed."\n \n \n

Warns URL: ".$warnsurl."\n \n \n

Has mic: ".$hasmic."\n \n \n

Hours online provided: ".$hoursonlineprovided."\n \n \n

Why wants to be part from the staff team: ".$whywantstobefromthestaff."\n \n \n

Actual rank: ".$actualrank."\n \n \n

Has donated: ".$hasdonated."\n \n \n

Age: ".$age."\n \n \n

PLEASE BE SURE TO MAIL TO '".$mail."' IF HE DID IT OR NOT!

THIS IS AN AUTOMATED MESSAGE, PLEASE DO NOT REPLY!

"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= 'From: noreply@vanityrp.site.nfoservers.com' . "\r\n"; mail($to,$subject,$message,$headers); } ?>

2022 WebDevInsider