Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble with script

Status
Not open for further replies.

MAWarGod

Programmer
Feb 15, 2002
352
US
<?php
$TITLE = fopen (&quot;/RGW/conf/2015/TITLE.conf&quot;, &quot;w+&quot;);
$ACTIONS = fopen (&quot;/RGW/conf/2015/action.conf&quot;, &quot;w+&quot;);
$HEADER2 = fopen (&quot;/RGW/conf/2015/header2.conf&quot;, &quot;w+&quot;);
$BANNERFILE = fopen (&quot;/RGW/conf/2015/banner.file&quot;, &quot;w+&quot;);
$BANNERFREQUENCY = fopen (&quot;/RGW/conf/2015/autopostsrate.conf&quot;, &quot;w+&quot;);
$LEAVEMESSAGE = fopen (&quot;/RGW/conf/2015/leave.conf&quot;, &quot;w+&quot;);
if ($TITLE)
{ print&quot;<font face=Arial,Helvetica>Room Name:</font><input name=TITLE TYPE=text VALUE='$TITLE' SIZE=20><br>&quot;; }

else
{ print&quot;The file does not exist&quot;; }
if ($ACTIONS)
{ print&quot;<p><font face=Arial Black><font size=+1>Edit the room actions</font></font><br><font face='Arial,Helvetica'>You can edit your room's actions here.This is a very powerful configuration option and not one to be fiddled with unless you know what you are doing.  The first part of the action is what shows on the pulldown, and should not have any HTML tags in it. The second part of the action is what is shown in the rooms. This second part can contain arbitrary HTML, as well as $1, for the victim and $2 for the message. Each part is separated by the | character (which you might have to look closely at your keyboard for. Below is the default configuration of the room actions, and you can use this to help you understand the above.</font><p><textarea rows=5 cols=60 name=ACTIONS value=$ACTIONS wrap=physical>$ACTIONS</TEXTAREA><br>&quot;; }
else
{ print&quot;The file does not exist&quot;; }
if ($HEADER2)
{ print&quot;<font face=Arial,Helvetica>Controls the background setting of lowwer frame<br> HEADER2:</font><input name=HEADER2 TYPE=text VALUE='$HEADER2' SIZE=70><br>&quot;; }
else
{ print&quot;The file does not exist&quot;; }
if ($BANNERFILE)
{ print&quot;<font face=Arial,Helvetica>HTML for AUTO POSTING IN LOWWER Frame<br> AUTO POST:<textarea rows=5 cols=60 name=BANNERFILE value=$BANNERFILE wrap=physical>$BANNERFILE</TEXTAREA><br>&quot;; }
else
{ print&quot;The file does not exist&quot;; }
if ($BANNERFREQUENCY)
{ print&quot;<font face=Arial,Helvetica>Auto Post Frequency:</font><input name=BANNERFREQUENCY TYPE=text VALUE='$BANNERFREQUENCY' SIZE=3><br>&quot;; }
else
{ print&quot;The file does not exist&quot;; }
if ($LEAVEMESSAGE)
{ print&quot;<font face=Arial,Helvetica>LEAVEMESSAGE:</font><input name=LEAVEMESSAGE TYPE=text VALUE='$LEAVEMESSAGE' SIZE=20><br>&quot;; }
else
{ print&quot;The file does not exist&quot;; }
{ print&quot;<br><form METHOD=POST ACTION=Roomediter.php><font face=Arial,Helvetica>&quot;; }
{ print&quot;<input type=submit value=MakeRoom></form></td>&quot;; }
?>
MA WarGod

I believe if someone can think it, it can be programmed
 
I want each of these file to open in a editable box allowing user to edit files

but when I try it this way Resource id #1 and so on in the boxs MA WarGod

I believe if someone can think it, it can be programmed
 
try actually reading data, fopen just opens the file for the mode you specify ('w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.). You want to open a file for reading, use: 'r' (Open for reading only; place the file pointer at the beginning of the file).

Also you need to use fgets to retrieve text from the file, refer to for more information --BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top