Tony O'Byrne
asked on
PHP auto-fil and auto-submit html form
I've got a weird idea here and was wondering how to go about it. (I have no idea as to where to start.)
I've got a web-form that enters data into a mysql database when the user submits. I would like to program a php script to automagically fill in the info *and* submit it so that I can automate a whole bunch of entries (1000 for example) so I can have a ton of random sample data to work with for some other scripts that will pull this data and possibly try to trend it.
Just so we're 100% clear, I know I can do it from the shell easy enough, but the thought struck me "I wonder if I could do it this other way?" So this is more of a curiosity than anything.
I've got a web-form that enters data into a mysql database when the user submits. I would like to program a php script to automagically fill in the info *and* submit it so that I can automate a whole bunch of entries (1000 for example) so I can have a ton of random sample data to work with for some other scripts that will pull this data and possibly try to trend it.
Just so we're 100% clear, I know I can do it from the shell easy enough, but the thought struck me "I wonder if I could do it this other way?" So this is more of a curiosity than anything.
Yes, you can post information to a script. I use fsockopen() to do that. I will post an example here for you in a moment. ~Ray
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is the "catcher" script.
<?php // RAY_dump_superglobals.php
error_reporting(E_ALL);
// OPEN AN OUTPUT BUFFER
ob_start();
// SHOW THE SUPERGLOBALS
echo "\nGET "; var_dump($_GET);
echo "\nPOST "; var_dump($_POST);
echo "\nCOOKIE ";var_dump($_COOKIE);
// CAPTURE THE BUFFER
$vardump = ob_get_clean();
// SEND THE RESULTS
mail('you@your.org', 'VARDUMP', "$vardump");
// SHOW THE RESULTS
echo htmlentities($vardump);
?>
ASKER
What's the "catcher" script for?
ASKER
Looks like this'll do. :-) It gives me something to work off of which is what I was looking for. If I have any further issues, I'll create a new thread. Thanks for the help.
The catcher script will receive the POST data and print it out for you.
Thanks for the points - it's a great question, ~Ray
Thanks for the points - it's a great question, ~Ray
ASKER
As I said, I've no idea where to start and my above terminology may be ... terminal. Terminal terminology. :-)