Image

Imagexandar wrote in Imagephp 😣cranky

Listens: Fusion - DJ NS

Help needed!

Hello!

I found this PHP Community while browsing random LiveJournals, and as a matter of fact, I need help with a script I am trying to write...

Help would be appreciated ^_^;

Now this is the problem:

I want to design an "Update Console" for a friend's site. This is so my friend, who is not at all experianced with HTML can update his website from a user friendly form.

I have firstly designed a page in SHTML with the following form on. It goes along the lines of:

Title of Website: [Input box here]
Content of Site: [Input Box here]

[Submit Button]


Now, I have designed the following PHP script to take the data from the Title of Website and save it to a text file called "main_windowtitle.txt". Here is the script:

<?

$mainwindowtitle = fopen("edits/main_windowtitle.txt", "w");

if (!mainwindowtitle) {
print("Could not update file!");
exit;
}

fputs($mainwindowtitle,"$main_windowtitle");

print("Thanks!");

fclose($mainwindowtitle);


?>


This works all fine, the data from the input box for 'Title of Website' writes to the text file and it appears on the main site (I included the text file virtually).

But... here's my problem...

I want to make the PHP script also save the data from the 'Content of Site' Input box into a Text File called "main_content.txt", using the same form on the SHTML page, and not using multiple PHP scripts.

When I try to do though though, I always get errors!

Can anyone help me?

Xanni