Results 1 to 3 of 3
Dear people, i have a script test.php which outputs a img tag to the internet browser whos src is an external URL with multiple parameters. The URL uses the parameters ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-24-2012 #1
- Join Date
- Sep 2012
Call a URL from command line or cronjob with lynx and wget
i have a script test.php which outputs a img tag to the internet browser whos src is an external URL with multiple parameters.
The URL uses the parameters to import statistics after a click on my site.
A cronjob should now either call the external URL which is contained in the img src attribute, or the script test.php. I cannot get either to work.
I tried wget and lynx to call the URL pointing to test.php and also the direct URL from the img source. Calling the url/test.php ends in timeout. (Maybe because the domain is forwarded to the same server as i type the commands in) Calling the URL of img src directly via lynx or wget does not import the statistiks that i need.
What else can i try to call the URL? (The same way i would call it from my browser)
I would be glad for any help
- 09-24-2012 #2
I'm not entirely sure I understand your question, so let me see if I can get it right:
You need to have a cronjob pull the external URL from the <img> element in your code, or run the script test.php if no URL exists, right? Are you trying to just copy the URL to the clipboard, or wget the actual html file and then open it via a browser?
What does your code look like so far?
- 09-25-2012 #3
- Join Date
- Sep 2012
Thank you for your reply.
Its best to forget trying to wget the test.php on my server. It was more an alternate choice. But it seems i cannot get wget to download URLs thats point to that same server as i am wgetting from.
I will try in other words:
Normally if i go to a certain page on my site, a file will be included where an image is outputted. The src of that <img> is as follows URL / cgi-bin / script.php / ? / param1 = 123 / & / param2 = 1234 / & / param3 = 3 / & / param4 = 4 / & / param5 = 5 (not allowed to post URLS sorry)
When i go to test.php for example (where the image is outputted) then the statistics import as they should.
When i try to call the URL of the img source with wget in the command line i dont get those statistics.
If any help, this is to integrate a webmaster programm. Maybe you can imagine better what i am trying to do.
I am now looking into the wget command with options --referer, --cookies, --keep-session-cookies, --save-cookies, --load-cookies