Peuplarchie Posted July 26, 2008 Share Posted July 26, 2008 Good day to you all, I'm working on a php text based login script. I'm at building the script to add, delete or edit account. Here my problem : When I enter a name password, it add it twice to the txt file. Also, it oly add the ame of the field and not it value. Here's my code : <?php $username = $_POST['username']; $password = $_POST['password']; $url = $_POST['url']; function add_user($user,$url,$pass) { $fopen = fopen('info.text', 'a'); fwrite($fopen, "\n,'".$user."' => '".$url."' => '".$pass."'"); fclose($fopen); } add_user('username','password','url'); ?> <html> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="username" /> <input type="text" name="password" /> <select name="url"> <option value="Director/index.php">Director</option> <option value="Admin/index.php">Admin</option> <option value="User/index.php">User</option></select><br /> <input type="submit" /><br /> </form> Preview:<br /> <?php if(isset($_POST['html'])) echo stripslashes($_POST['html']); ?> </body> </html> Thanks ! Take care ! Link to comment https://forums.phpfreaks.com/topic/116762-selfsubmit-form-problem/ Share on other sites More sharing options...
Peuplarchie Posted July 27, 2008 Author Share Posted July 27, 2008 It's solved now ! Link to comment https://forums.phpfreaks.com/topic/116762-selfsubmit-form-problem/#findComment-600723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.