Current location: Hot Scripts Forums » Programming Languages » PHP » CRON JOB with php file


CRON JOB with php file

Reply
  #1 (permalink)  
Old 06-23-07, 06:17 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
CRON JOB with php file

Hi, i am wanting to use a cron job with my php file, and if possible use ?x=value at the end, ie
PHP Code:

www.site.com/script.php?name=jay 

or
PHP Code:

/home/jay6390/public_html/script.php?name=jay 

1. Is it possible to do this (please note i am using cPanel)
2. which of the two above should i use for this

Many thanks

Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Reply With Quote
  #2 (permalink)  
Old 06-23-07, 09:42 PM
koncept
Guest
 
Posts: n/a
im pretty sure its the second one. your host should have a good guide based on their security policy
Reply With Quote
  #3 (permalink)  
Old 06-23-07, 09:46 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
thanks, i'll contact them as well

Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Reply With Quote
  #4 (permalink)  
Old 06-23-07, 09:51 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
just have

"I'm sorry, I'm afraid I can't assist you with that problem"

Very f***ing useful!

Poo!
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Reply With Quote
  #5 (permalink)  
Old 06-23-07, 10:49 PM
Sxooter Sxooter is offline
Newbie Coder
 
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Does your machine have wget on it?

wget http://site.com/script.html?arg1=val1
__________________
Post a clear description of your problem, your code in code tags, your errors, and wait. Because nobody here's a mind reader...
Reply With Quote
  #6 (permalink)  
Old 06-23-07, 11:13 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
i dont know. how can i tell in cpanel?
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Reply With Quote
  #7 (permalink)  
Old 06-24-07, 09:11 AM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
Sorted

just needed to run via php with the following
php /home/jay6390/public_html/script.php

I cant do it with the ? in it though. does anyone have any suggestions as to how i can
achieve this?

Thanks

Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Reply With Quote
  #8 (permalink)  
Old 06-24-07, 01:53 PM
Sxooter Sxooter is offline
Newbie Coder
 
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
You'll need to rewrite it to $argv[] $argc and give it arguments.

so,if you call it as:

/home/jay6390/public_html/script.php filename emailaddress

then the script would have:

$argc=3
$argv[0] = /home/jay6390/public_html/script.php
$argv[1] = filename
$argv[2] = emailaddress

best way to find out if you have wget is to just try it. i.e. make a cron entry and see if it works.
__________________
Post a clear description of your problem, your code in code tags, your errors, and wait. Because nobody here's a mind reader...
Reply With Quote
  #9 (permalink)  
Old 06-24-07, 02:05 PM
Sxooter Sxooter is offline
Newbie Coder
 
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
P.s. read this page on using php from the command line for more info.
__________________
Post a clear description of your problem, your code in code tags, your errors, and wait. Because nobody here's a mind reader...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically send email to the particular person everyday sujata_ghosh PHP 7 10-04-11 05:00 PM
PHP displaying in .HTML file tennis4you PHP 6 12-31-06 08:17 PM
Edit Text File with PHP jengels PHP 2 12-07-06 11:04 AM
PHP based File Tracker project valtea Script Requests 0 09-08-05 02:04 PM
Cron Job Error Tempestshade PHP 6 09-10-04 05:10 PM


All times are GMT -5. The time now is 06:06 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.