jcsarmento Posted July 12, 2009 Share Posted July 12, 2009 Hi, I have a php file that has a post. but this post is not manual, it´s through a cronjob, and for me it does not work. in my file named "file_that_sends_post.php" I have: <?php . . . $string2=999; $customer_post_key=555; $action=$customer_domain."/file_post_receiver.php"; ?> <form name=”post” action=<?php echo $action ?> method="post" > <input type="hidden" name="string" value=<?php echo $string2 ?> > <input type="hidden" name="origem" value=<?php echo $customer_post_key ?> > </form> <script language="JavaScript"> document.forms[0].submit(); </script> ----------------------- And this works perfect if I run it on a browser like firefox! but this does NOT work if I run it on a cron job on the server . The cron Job Im using is: wget -nd --delete-after '(mydomain)/file_that_sends_post.php' >/dev/null 2>&1 (mydomain) is the full adress including http, I did not put here because this editor does not let me because im new on this forum. I think it´s the javascript part...that apache can´t execute. is it? Can anyone help me on this one? many thanks. jsarmento Quote Link to comment https://forums.phpfreaks.com/topic/165734-usage-of-cronteb-to-submit-post-action/ Share on other sites More sharing options...
.josh Posted July 13, 2009 Share Posted July 13, 2009 It's because php doesn't care about your form or the javascript that submits it or any of that. As far as its concerned, it's random text. What you can do is use cURL to have php post data to another page/server/whatever. Quote Link to comment https://forums.phpfreaks.com/topic/165734-usage-of-cronteb-to-submit-post-action/#findComment-874289 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.