I've been stuck with this and have been searching solutions but it still doesn't seem to work could someone help :))
<?php
if(isset($_POST['submit_btn']))
{
$file = fopen("data.txt", "a");
fwrite($file,"in game name :");
fwrite($file, $ingname."\n");
fwrite($file,"firstname :");
fwrite($file, $name."\n");
fwrite($file,"discord name :");
fwrite($file, $dname."\n");
fwrite($file,"main lengend :");
fwrite($file, $mlengend."\n");
fwrite($file,"secondary lengend :");
fwrite($file, $slengend."\n");
fwrite($file,"third legend :");
fwrite($file, $tlengend."\n");
fclose($file);
}
?>
this is the php code in the file config.php
<div class="container">
<div class="title">Registration</div>
<form action="/config.php" method="POST">
<div class="user-details">
<div class="input-box">
<span class="details">In game name</span>
<input type="text" name="ingname" placeholder="" required>
</div>
<div class="input-box">
<span class="details">Firstname</span>
<input type="text" name="name" placeholder="" required>
</div>
<div class="input-box">
<span class="details">Discord username</span>
<input type="text" name="dname" placeholder="" required>
</div>
<div class="input-box">
<span class="details">Main legend</span>
<input type="text" name="mlengend" placeholder="" required>
</div>
<div class="input-box">
<span class="details">Secondary legend</span>
<input type="text" name="slengend" placeholder="" required>
</div>
<div class="input-box">
<span class="details">Third legend</span>
<input type="text" name="tlengend" placeholder="" required>
</div>
</div>
<div class="region">
<p class="questionR">What is your region?</p>
<select name="select">
<option value="Europe" name="regiondata" selected>Europe</option>
<option value="North-America" >North-America</option>
<option value="South-America" >South-America</option>
<option value="Africa" >Africa</option>
<option value="Asia" >Asia</option>
<option value="Australia" >Australia</option>
</select>
</div><br>
<div class="kdascreen">
<form>
<span class="kdaQuest">Please provide a screenshot of your overall stats</span><br>
<input type="file" id="kdaUser" name="kdaFile">
</form>
</div>
<br>
<div class="platform">
<input type="radio" name="plat" id="dot-1">
<input type="radio" name="plat" id="dot-2">
<input type="radio" name="plat" id="dot-3">
<input type="radio" name="plat" id="dot-4">
<span class="platform-choice">On what platform do you play on?</span>
<div class="platform-category">
<label for="dot-1">
<span class="dot one"></span>
<span class="plat">PSN</span>
</label>
<label for="dot-2">
<span class="dot two"></span>
<span class="plat">Xbox</span>
</label>
<label for="dot-3">
<span class="dot three"></span>
<span class="plat">PC - Mouse and keyboard</span>
</label>
<label for="dot-4">
<span class="dot four"></span>
<span class="plat">PC - Controller</span>
</label>
</div>
</div>
<div class="rulesTOS">
<input type="radio" name="choiceMade" id="pot-1">
<input type="radio" name="choiceMade" id="pot-2">
<span class="readrules">Have you read the <a href="rules.html" target="_blank">rules</a> and agreed with the <a href="https://tos.ea.com/legalapp/WEBTERMS/US/en/PC/" target="_blank">TOS?</a></span>
<div class="choice">
<label for="pot-1">
<span class="pot one"></span>
<span class="choiceMade">Yes</span>
</label>
<label for="pot-2">
<span class="pot two"></span>
<span class="choiceMade">No</span>
</label>
</div>
</div>
<br>
<div class="button">
<input type="submit" name="submit_btn" value="submit"/>
</div>
</form>
</div>
this is the form in the file registreren.html I've been messing around and even made this file a php file still didn't seem to work I think I might have made a stupid mistake that might have made it no to work.
#edit
I added the $_POST["xxx"] and gave it reading an writing premissions but still can't seem to save the data to the data.txt file.
<?php
if(isset($_GET['submit_btn']))
{
$file = fopen("data.txt", "a");
fwrite($file,"in game name :");
fwrite($file, $_POST["ingname"]."\n");
fwrite($file,"firstname :");
fwrite($file, $_POST["name"]."\n");
fwrite($file,"discord name :");
fwrite($file, $_POST["dname"]."\n");
fwrite($file,"main lengend :");
fwrite($file, $_POST["mlegend"]."\n");
fwrite($file,"secondary lengend :");
fwrite($file, $_POST["slegend"]."\n");
fwrite($file,"third legend :");
fwrite($file, $_POST["tlegend"]."\n");
fclose($file);
chmod("data.txt", 7777);
}
?>