Jump to content

problem with code logging data from a form


timebandit

Recommended Posts

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;
?>

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:

 

::

::

::

::

::

::

::

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.

Archived

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

×
×
  • 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.