KoA Posted December 1, 2007 Share Posted December 1, 2007 I've Been Wondering Is there any way that at a certain time a script can copy a text of a web page and submit the text into a simple form. Is this possible. For Example: Every Day There is a New Riddle at 3PM Would there be any way that at 3pm it copies the riddle, which is always in the same spot, and put it in a simple 1 form page? Quote Link to comment Share on other sites More sharing options...
trq Posted December 1, 2007 Share Posted December 1, 2007 You would need to have your script executed via cron at a specific interval. Quote Link to comment Share on other sites More sharing options...
KoA Posted December 1, 2007 Author Share Posted December 1, 2007 You would need to have your script executed via cron at a specific interval. Alright, I Could probably figure out the time part, however, what about the script it self to copy the code and put it in a simple one form page. Quote Link to comment Share on other sites More sharing options...
KoA Posted December 2, 2007 Author Share Posted December 2, 2007 Any Idea on what to do? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 2, 2007 Share Posted December 2, 2007 The cron job includes the call that runs your .php script that does that. Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 Why do you want to put it in a form? Does this form submit the data somewhere else? Quote Link to comment Share on other sites More sharing options...
KoA Posted December 2, 2007 Author Share Posted December 2, 2007 Why do you want to put it in a form? Does this form submit the data somewhere else? Currently working on a Project. I Have a page that shows a code And at X Time I Want it to submit the code into a form on a different directory. All the form does Atm is direct you to another location, but when it's completed data would be submitted to a database. I Can get the cronjob working, however, it's the PHP I'm having difficulty with. Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 Well, to put it simply. You dont want (need) to place the data into a form and then submit the form. All you need do is write the script to scrape the data, and insert into into the database. Quote Link to comment Share on other sites More sharing options...
KoA Posted December 2, 2007 Author Share Posted December 2, 2007 Well, to put it simply. You dont want (need) to place the data into a form and then submit the form. All you need do is write the script to scrape the data, and insert into into the database. It's sort of an 'Access Code'. It will then redirect to what you can call a 'Members Area' then save the information used into a database. Just looking for an automated script to copy the access code and then submit it. I Can get the info into the database, then redirect. Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 Just looking for an automated script to copy the access code and then submit it. Yes, straight to a database. Why make it hard on yourself? Quote Link to comment Share on other sites More sharing options...
KoA Posted December 2, 2007 Author Share Posted December 2, 2007 Just looking for an automated script to copy the access code and then submit it. Yes, straight to a database. Why make it hard on yourself? However, In order to get into the 'Members Area' the code needs to be submitted. The database is not the only thing. Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 Are you trying to submit data to a remote site or something you have control over? if the later, your trying to go about it the hard way, the former, you will need to take a look at the curl extension. Quote Link to comment Share on other sites More sharing options...
KoA Posted December 2, 2007 Author Share Posted December 2, 2007 Are you trying to submit data to a remote site or something you have control over? if the later, your trying to go about it the hard way, the former, you will need to take a look at the curl extension. Currently I Have control of it, but i'm not trying to do it within the server it self. It's my site Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2007 Share Posted December 2, 2007 Take a look at curl then. There should also be plenty of tutorials around for submitting data via php & curl. Quote Link to comment Share on other sites More sharing options...
BradleyBrokers Posted December 2, 2007 Share Posted December 2, 2007 Does this help?: $StartDate = "4 April 2004"; $PeriodHours = 24; $PerCount = (int) ((time() - strtotime ($StartDate)) / ($PeriodHours*60*60)) ; 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.