Jump to content

Submitting To Submit


absorr

Recommended Posts

Don't explain how? When it comes to web development (or anything that requires some learning), you have two choices: hire somebody to do it or learn it yourself. This task you want will require a server-side language. PHP is the language of my choice, but it depends on what you need. First, you need to learn how to use forms and the $_POST array. This will help you get the data to the script that will modify the other HTML document. You can use file_put_contents() to change the file. While that solution fits the requirements you posted, I'm guessing you actually want to choose where in the HTML document you want the new content to be placed. That task is a lot more difficult; you would want to build a content management system and that required working with databases.

Link to comment
Share on other sites

By don't explain I meant don't give me an essay. I did say I would like some basics. And yes, I am mainly aiming for the code, but that does not mean I don't want anything else. And also I'm not aiming to place it in a certain place in the document. I'm puting it in a separate place so i can use an iframe to get the code in. That's just some things I wanted to clarify. Thanks Duotone Fox for your great answer.

Link to comment
Share on other sites

Ok, now that I have it so that it submits things in a forum to a txt via php, how do I make it so that when it puts things in the txt it doesn't replace whats already there? Reply to this in any way, sorry if my restrictions above were annoying.The code for the PHP is <?php$a_str = array($_POST["fname"],$_POST["age"]);$contents = implode(PHP_EOL, $a_str);$contents .= PHP_EOL . PHP_EOL;file_put_contents("testtxt.txt", $contents);print("|$contents|");?>if that helps you

Link to comment
Share on other sites

file_put_contents has parameters you can use so it appends to the existing file.http://es.php.net/file_put_contents Example:

file_put_contents('file.txt', 'Data', FILE_APPEND);

Link to comment
Share on other sites

file_put_contents has parameters you can use so it appends to the existing file.http://es.php.net/file_put_contents Example:
file_put_contents('file.txt', 'Data', FILE_APPEND);

THANK YOU THANK YOU THANK YOU! That worked perfectly! Funny story, I asked my Web Design teacher about this and he said he barely knew anything about PHP so he gave me 2 huge books to look through.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...