A
Anonymous
Guest
Hi I am very new to PHP but have managed to put togther a page that interacts with text files for regional leaders of my club to be able to edit there details.
The problem i am having is one of the files contains a HTML link
e.g. <A HREF=" etc etc
and when it is loaded into the form is mucks up the form.
I have been told I need to use htmlspecialchars????
This is the code if anybody can help it will be much appreciated
Cheers Baz
The problem i am having is one of the files contains a HTML link
e.g. <A HREF=" etc etc
and when it is loaded into the form is mucks up the form.
I have been told I need to use htmlspecialchars????
This is the code if anybody can help it will be much appreciated
Cheers Baz
Code:
<h1 align="center"><font color="#000099"><a name="top"></a>
<?php
include 'regionalname.txt';
?> Update Page
</font></h1>
<p align="center">Only
<?php
include 'rlname.txt';
?>
Has Permission To Update This Page
<form method=post>
<input type="hidden" value="<?php $tmp=($_POST["file"])?$_POST["file"]:$_GET["file"]; echo $tmp;?>" name="file">
<select name ="file">
<option value=""> Please Choose From Bellow
<option value="regionalname.txt"> Region Name
<option value="rlname.txt"> Regional Leaders Name
<option value="forumid.txt"> Forum ID
<option value="meetdate.txt"> Meet Date
<option value="nxtmeet.txt"> Next Meet
<option value="forumid.txt"> Forum ID
<option value="map.txt"> Map to meet location
<option value="meetcomments.txt"> Meet Comments
<option value="website.txt"> Regional Website Link
<option value="contact.txt"> Contact Details
</select>
<input value="Open File" type=submit><hr>
<p>
<?php
if ($_POST["submit"]=="submit") { // begin if statement
if (@fwrite(@fopen($_POST["write"],"wb"), $_POST["filetext"])) {
echo "File write successful";
} else {
echo "File write unsuccessful";
}
} else { //begin else block ?>
<input name="filetext" type="text" value="
<?php echo @fread(@fopen($tmp,"r"), @filesize($tmp));?>
" size="90">
<p> Please Confirm The File To Be Updated
<select name ="write">
<option value=""> Please Choose From Bellow
<option value="regionalname.txt"> Region Name
<option value="rlname.txt"> Regional Leaders Name
<option value="forumid.txt"> Forum ID
<option value="meetdate.txt"> Meet Date
<option value="nxtmeet.txt"> Next Meet
<option value="map.txt"> Map to meet location
<option value="meetcomments.txt"> Meet Comments
<option value="website.txt"> Regional Website Link
<option value="contact.txt"> Contact Details
</select>
<p>
<input name=submit value=submit type=submit>
<?php } //end if statement?>
</form>
<p align="center"> </p>