I have been using this form script for a years now, however for some time have not checked it and seems it is no longer working.
Pasting simplified version, not sure how to proceed with it in PHP5, as in the past it was working correctly.
In the form, users is typing in one field his/her name and then when submitting, script should create a file called "save his/her name.html", however when submitting, server receives a file "save .html" with every $value not filled.
My server currently has PHP 5.4.45 installed, have tried on past PHP5 versions as well as on PHP7 with no luck.
Also tried few $_POST options, however with no luck, so pasting over last known working version.
FORM PHP FILE
<html>
<head>
<meta http-equiv='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta name='GENERATOR'>
<meta name='ProgId'>
<title>Save form</title>
<SCRIPT>
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=50
}
</SCRIPT>
<style type='text/css' rel='StyleSheet'>
A:link {
COLOR: White; TEXT-DECORATION: none
}
A:visited {
COLOR: White; TEXT-DECORATION: none
}
A:active {
COLOR: White; TEXT-DECORATION: none
}
A:hover {
COLOR: White; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 10px; COLOR: White; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
B {
FONT-SIZE: 10px; COLOR: White; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
TD {
FONT-SIZE: 10px; COLOR: White; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
BODY {
FONT-FAMILY: Verdana; FONT-SIZE: 10px; MARGIN: 0px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
--></style>
</head>
<body bgcolor='#00500B'>
<p>Please fill the form</p>
<form action="save.php" method="post" enctype="multipart/form-data">
<table width='100%'>
<tbody>
<tr>
<td width='478' height='25'>Player:<br>
<p> </p>
</td>
<td vAlign='top' width='278' height='24'><input name='player' id='player' size='20'></td>
</tr>
<tr>
<td width='478' height='25'>Character:<br>
<p> </p>
</td>
<td vAlign='top' width='278' height='24'><input type="text" name="charactername" id="charactername" size='20'></td>
</tr>
<tr>
<td width='478' height='25'>Type:
<p> </p>
</td>
<td vAlign='top' width='278' height='25'><select size='1' name='type' id='type'>
<option value='type1' selected>Type one</option>
<option value='type2'>Type two</option>
</select></td>
</tr>
<tr>
<td width='692' colSpan='2' height='20'>
<p align='center'><br>
<input type='submit' value='Submit the form'><br>
</p>
</td>
</tr>
</FORM>
</tbody>
</table>
</html>
SAVE.PHP script that should create a file:
<html>
<head>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Page Title</title>
<style type="text/css" rel="StyleSheet">
A:link {
COLOR: #FFFFFF; TEXT-DECORATION: none
}
A:visited {
COLOR: #FFFFFF; TEXT-DECORATION: none
}
A:active {
COLOR: #FFFFFF; TEXT-DECORATION: none
}
A:hover {
COLOR: #FFFFFF; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 10px; COLOR: #FFFFFF; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
B {
FONT-SIZE: 10px; COLOR: #FFFFFF; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
TD {
FONT-SIZE: 10px; COLOR: #FFFFFF; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
BODY {
FONT-FAMILY: Verdana; FONT-SIZE: 10px; MARGIN: 0px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
--></style>
</head>
<?
$file = fopen("save $charactername.html","w");
$a="
<html>
<head>
<title>Page title</title>
<meta http-equiv='Content-Type' CONTENT='text/html; charset=utf-8'>
<style type='text/css'>
<!--
div#menu { padding-left: 4px; color: #FFFFFF; float: center; font-family: Verdana; margin-right: 0px; font-size: 10px; }
div#menu a { padding-left: 4px; text-decoration: none; font-family: Verdana; color: #FFFFFF; padding: 1px; margin-top: 0px; width: 100px; }
div#menu a:hover { color: #C0C0C0; font-family: Verdana; }
div#text { padding-left: 3px; padding-right: 3px; padding-top: 3px; float: center; font-family: Verdana; text-size: 9px; font-size: 10px; text-decoration: none; color: #FFFFFF; }
div#text a { color: #FFFFFF; }
div#text a:hover { color: #C0C0C0; }
div#title { font-weight: bold; padding-left: 10px; float: center; margin-right: 4px; font-family: Verdana; text-size: 9px; font-size: 10px; text-decoration: none; color: #FFFFFF; }
div#title { font-weight: bold; padding-left: 65px; float: center; margin-right: 4px; font-family: Verdana; text-size: 9px; font-size: 10px; text-decoration: none; color: #FFFFFF; }
-->
</style>
</HEAD>
<html>
<body bottommargin='0' leftmargin='0' topmargin='0' style='cursor:crosshair; background-color:#000B26; color:#999500' bgcolor='#000B26'>
<center>
<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='300' height='500' id='text' background='$type.jpg'>
<tr>
<td rowspan='6' width='25'> </td>
<td width='250' height='24' colspan='2' valign='top'>
<center>
<div id='text'>
<b>Player</b>: $player
<b>Character</b>: $charactername
</div>
</center>
</td>
<td rowspan='6' width='25'> </td>
</tr>
</table>
</center>
</body>
</html>
";
fputs($file,"$a
");
fclose($file);
print('Save has been sent to server. Thank you');
?>
</html>
Are you able to advise how to change/repair the code, so that it would: 1. create a file with correct file name 2. have all variable $ filled in created file as per User's input.