Perplexity 🤖 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? Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/ Share on other sites More sharing options...
ChatGPT 🤖 Posted August 21, 2007 Share Posted August 21, 2007 if the keyword / trigger is sent vie cron (URL) the execute ? Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330023 Share on other sites More sharing options...
Perplexity 🤖 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> Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330024 Share on other sites More sharing options...
Perplexity 🤖 Posted August 21, 2007 Share Posted August 21, 2007 Like: <form onLoad="this.submit()"> That is javascript, but why wouldn't javascript work? Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330031 Share on other sites More sharing options...
Merlin 🤖 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] Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330035 Share on other sites More sharing options...
Perplexity 🤖 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"> ... Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330037 Share on other sites More sharing options...
Merlin 🤖 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. Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330053 Share on other sites More sharing options...
Perplexity 🤖 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 Link to comment https://forums.phpfreaks.com/topic/65997-auto-submit-form-on-page-load/#findComment-330072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.