bradkenyon Posted August 21, 2007 Share Posted August 21, 2007 i have a cronjob to run a php file at a certain time of the day. it originally was suppose to run the php mail function, easy enough, right?? but no, the php mail function is not enabled on the server - just my luck. all i need to do is send two values from a database table within an email. i was thinking, i could probably create a form which plugs the two values into fields, and use the mail cgi file to send it that way, but I'd need to submit the form on page load (without someone actually clicking the submit button). I could use javascript, but the cronjob would ignore the javascript. any ideas? Quote Link to comment Share on other sites More sharing options...
jvrothjr Posted August 21, 2007 Share Posted August 21, 2007 if the keyword / trigger is sent vie cron (URL) the execute ? Quote Link to comment Share on other sites More sharing options...
bradkenyon Posted August 21, 2007 Author Share Posted August 21, 2007 if the keyword / trigger is sent vie cron (URL) the execute ? essentially, i want it to be this <form "something in here will make it automatically submit the form> values already set when page loads </form> Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 21, 2007 Share Posted August 21, 2007 Like: <form onLoad="this.submit()"> That is javascript, but why wouldn't javascript work? Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 21, 2007 Share Posted August 21, 2007 Try this. <html> <head> <script type="text/javascript"> function submit(form){ document.form.submit(); } </script> </head> <body onLoad="javascript:submit(myForm)"> <form action="script.php" method="post" name="myForm"> Name: <input type="text" name="Name" value="Predefined"/> Password: <input type="text" name="Password" value="Predefined"/> <input type="submit" name="submit"/> </form> </body> </html>/code] Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 21, 2007 Share Posted August 21, 2007 Actually, I don't think the form tag has the onLoad event. NArc0t1c's code should work, though it seems a unnecessarily indepth. Wouldn't this work? <body onLoad="myForm.submit()"> <form name="myForm"> ... Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted August 21, 2007 Share Posted August 21, 2007 Actually, I don't think the form tag has the onLoad event. NArc0t1c's code should work, though it seems a unnecessarily indepth. Wouldn't this work? <body onLoad="myForm.submit()"> <form name="myForm"> ... Mine is a little bit long.. Yes your's would also work. Quote Link to comment Share on other sites More sharing options...
bradkenyon Posted August 21, 2007 Author Share Posted August 21, 2007 how about thish? http://netevil.org/blog/2006/nov/http-post-from-php-without-curl 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.