timebandit Posted January 10, 2009 Share Posted January 10, 2009 the following code below does not log what it should be logging to the specified text file, it only logs this: : here's my code, maybe someone can help? <?php $handle = fopen("data.txt", "a"); $string = $_GET['username'] . ":" . $_GET['passwd'] . ":" . $_GET['gender'] . "\r\n"; fwrite($handle, $string); header("Location:http://url goes here"); fclose($handle); exit; ?> Quote Link to comment Share on other sites More sharing options...
envexlabs Posted January 10, 2009 Share Posted January 10, 2009 What is your form method set to? Are you seeing the results in the address bar at all? ie: index.php?username=1&password=2 Quote Link to comment Share on other sites More sharing options...
timebandit Posted January 10, 2009 Author Share Posted January 10, 2009 What is your form method set to? Are you seeing the results in the address bar at all? ie: index.php?username=1&password=2 hi, my form method is set to POST, i am also seeing no results in the address bar. Quote Link to comment Share on other sites More sharing options...
RestlessThoughts Posted January 10, 2009 Share Posted January 10, 2009 Ah, Envexlabs will probably tell you this. Either change your form method to GET (which will change the address bar) or where it says $_GET in your string change it to $_POST. Should work then. Quote Link to comment Share on other sites More sharing options...
timebandit Posted January 10, 2009 Author Share Posted January 10, 2009 Ah, Envexlabs will probably tell you this. Either change your form method to GET (which will change the address bar) or where it says $_GET in your string change it to $_POST. Should work then. hello, i've tried this has not changed the out come, it still only logs this: :: :: :: :: :: :: :: Quote Link to comment Share on other sites More sharing options...
envexlabs Posted January 11, 2009 Share Posted January 11, 2009 Hey, Make sure you form inputs have names, i know this is simple stuff, but even the best miss it sometimes. or print_r($_GET); and see if it returns empty, or if it returns values. print_r() is usually the place i goto when trouble shooting arrays. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 11, 2009 Share Posted January 11, 2009 Post your form to get help with why it is not sending the data you expect. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.