Editing a file w/ a php form?
Posted: Wed Jan 19, 2005 8:12 pm
Hello,
Im new to php, I can only do the basics. includes, a little bit of smarty templates etc. Im trying to figure out something, that is probably very simple, but I just cant figure it out. I need a form, to edit a file, save the file, and execute a batch file or windows 2003 console command.
The form would need to edit the
Portion of the xml file, not the entire <parameters> string though, just the -game dod part and the +map part. Maybe with a drop down menu w/ a selection of mod type w/ default maps?.
After that information is changed, the file would need to be saved, then the command or a batch file like the below would need to be executed
How hard would this be to do? If easy, can someone please help me?
Brandon
Im new to php, I can only do the basics. includes, a little bit of smarty templates etc. Im trying to figure out something, that is probably very simple, but I just cant figure it out. I need a form, to edit a file, save the file, and execute a batch file or windows 2003 console command.
Code: Select all
<!-- Generated by FireDaemon OEM v1.7 GA (Build 1913) -->
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE Service SYSTEM "FireDaemon.dtd">
<Service>
<Program>
<Name>hlds server</Name>
<DisplayName>hlds</DisplayName>
<Description>Hlds dedicated server</Description>
<WorkingDir>D:\hlds\</WorkingDir>
<Executable>D:\hlds\hlds.exe</Executable>
<Parameters>+ip 67.19.224.36 -port 27015 -game dod -heapsize 131072 -maxplayers 20 +map dod_avalanche -console -autoupdate</Parameters>
<Delay>3000</Delay>
<ConsoleApp>false</ConsoleApp>
<ForceReplace>true</ForceReplace>
</Program>
<Options>
<AffinityMask>0</AffinityMask>
<Priority>0</Priority>
<AppendLogs>true</AppendLogs>
<EventLogging>true</EventLogging>
<InteractWithDesktop>true</InteractWithDesktop>
<PreLaunchDelay>0</PreLaunchDelay>
<StartUpMode>1</StartUpMode>
<UponExit>1</UponExit>
<UponFlap>0</UponFlap>
<FlapCount>0</FlapCount>
<ShutdownDelay>5000</ShutdownDelay>
<ShowWindow>2</ShowWindow>
<JobType>0</JobType>
</Options>
<Debug>
<DebugEnabled>true</DebugEnabled>
<DebugLocation>d:\hlds\debug\</DebugLocation>
</Debug>
<SMF>
<SMFEnabled>true</SMFEnabled>
<SMFFrequency>5000</SMFFrequency>
</SMF>
<Scheduling>
<StartTime>00:00:00</StartTime>
<EndTime>00:00:00</EndTime>
<RunDays>127</RunDays>
<MonthFrom>0</MonthFrom>
<MonthTo>0</MonthTo>
<MonthDay>0</MonthDay>
<RestartFreq>0</RestartFreq>
<RestartDelay>0</RestartDelay>
</Scheduling>
</Service>Code: Select all
<Parameters>+ip 67.19.224.36 -port 27015 -game dod -heapsize 131072 -maxplayers 20 +map dod_avalanche -console -autoupdate</Parameters>After that information is changed, the file would need to be saved, then the command or a batch file like the below would need to be executed
Code: Select all
net stop hlds
C:\program files\firedaemon\firedaemon -i filename.xmlBrandon