Jump to content

bklnthebeast

New Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bklnthebeast

  • Rank
    Newbie
  1. The PHP login system has been scripted by somebody else. So no, I did not manage to assemble a bug-free state-of-the-art login mechanism. Can anyone solve the script please?
  2. Thank you and I appreciate it. I am very aware of the dangers of using this method but only specific people will have access to these forms as it will be behind a login. Any ideas on how to make this script work would be greatly appreciated.
  3. Hey guys! I have a page that has multiple forms. I am trying to make a button that will save all the information from each textarea to a different .txt file. IE: textarea1 will save to textarea1.txt textarea2 will save to textarea2.txt textarea3 will save to textarea3.txt etc. I am able to save each individual form via individual submit buttons within each form, but I'd like to make a submit button outside of the other forms that saves all forms to their specific files. The code for one of the individual forms looks like this: <form method="post" action="?"> <h1>Physical Stats</h1> <textarea name="stats"><?php include ('resources/stats.txt'); ?></textarea> <br><input type="submit" name="update_stats" value="Update"/> </form> <?php if (isset($_POST['update_stats'])) { file_put_contents("resources/stats.txt", $_POST['stats']); } ?> Everything above works. And the code for the save all form looks like this: <form method="post" action="?"> <input type="submit" name="update_all" value="Update All"/> <br><br> </form> <?php if (isset($_POST['update_all'])) { file_put_contents("resources/stats.txt", $_POST['stats']); file_put_contents("resources/pro_exp.txt", $_POST['pro_exp']); file_put_contents("resources/pro_awards.txt", $_POST['pro_awards']); file_put_contents("resources/ama_exp.txt", $_POST['ama_exp']); file_put_contents("resources/ama_awards.txt", $_POST['ama_awards']); file_put_contents("resources/references.txt", $_POST['references']); } ?> This is the code I currently have and it's just not working. Right now the above code is actually clearing all of the text files. I'm afraid I'm a complete newb to writing scripts and I'm sure there is some rule about file_get_contents that I'm not aware of. Please help! Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.