4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Email question
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Tue Nov 05, 2002 6:41 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Some people these days....

I don't wanna use it to spam! I am running this silly competition thing for someone and I wanted to take them by surprise...long story.

Anyway.

I made the file crontest.php and uploaded it to www.extremelinks.net/crontest.php. It looked like this:
mail("ploptyplop@hotmail.com", "Hey", "Just a test", "From:Bill <billdavies@f2s.com>");

(this is just a test for me!)

I did what you said for all the boxes and under Command I wrote
/usr/local/bin/lynx --dump http://extremelinks.net/crontest.php

Is that all right?

I only want this to run once, now would I do that?

EDIT: Ok, I am really confused. My host told me he thinks (not always a good sign!) that the servers are set to Eastern Time blah blah blah. Now, I set up the above to run so that I would get it whilst I was on now. I haven't got anything, so I checked the time. I used

<html>
<body>
<?php echo gmdate("H i s M d Y");
?>
</body>
</html>

(just checking I did it right!) and it said that the server was running in GMT. So I set up another cron job and that hasn't worked. So what have I done wrong and what time zone is the server in?

Thanks
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Tue Nov 05, 2002 6:59 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Whoops! Forgot everything else on the crontest.php file.

That file then worked (I tested it!) but the cron thing still doesn't work. I even set it up to do every hour on a minute and it still didn't work so there is a problem somewhere. I tried dropping all the random stuff I don't understand at the front and just put the URL but that didn't either.

What am I doing wrong?!
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Nov 05, 2002 7:00 pm (15 years, 1 month ago) Reply with QuoteBack to Top

OK, well if you only want to run it once, then just go to http://extremelinks.net/crontest.php.

As to the timezone, running gmdate will always return a GMT time. To find out the timezone, run this PHP code:

Code:
date('T');

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Nov 05, 2002 7:00 pm (15 years, 1 month ago) Reply with QuoteBack to Top

OK, tell me what you have in every box and we'll see what's wrong.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Tue Nov 05, 2002 8:44 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Ok. crontest.php looked like this:

<html>
<body>
<?php mail("ploptyplop@hotmail.com", "Hey", "Just a test", "From:Bill <billdavies@f2s.com>");
?>
</body>
</html>

This is what my crontab looks like (by the way in the command I have:

/usr/local/bin/lynx --dump http://extremelinks.net/crontest.php

if you can't see it all).

Image

It is running in Eastern Standard Time if that helps.
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Nov 05, 2002 8:53 pm (15 years, 1 month ago) Reply with QuoteBack to Top

They all look OK to me. I would ask your host if crontabs are working... Do you get an email if you go to http://extremelinks.net/crontest.php?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Tue Nov 05, 2002 9:27 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Yup, and loads of lovely people keep visiting it!!
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Nov 06, 2002 3:10 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Just one thing: I would try creating another PHP script which sends a different email and NOT giving out the address Smile Then see if it works. If not then I would ask your host.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Wed Nov 06, 2002 4:02 pm (15 years, 1 month ago) Reply with QuoteBack to Top

You have 32 new email addresses. Thanks....!

I got this from my host:

"I am not sure if a PHP file can be run by Cron, the only thing I have
experience with is Perl files and so on. The Cron jobs are running correctly
thought because we are using one to backup our MySQL databases every night."

That sounds like right rubbish to me. I thought he was really helpful but he doesn't seem to have a clue now I've given him my money!

Where do I go from here, is there something else I can do to test if Cron actually works with PHP?

Can you do cron manually i.e not through an interface?

Thanks

Bill
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Thu Nov 07, 2002 5:35 pm (15 years, 1 month ago) Reply with QuoteBack to Top

just a thought:

[adammc@phenix adammc]$ links --dump http://www.cuo.org.uk/
Unknown option --dump

the option is -dump not --dump

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Thu Nov 07, 2002 5:51 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Wierd... it's --dump at 4WebHelp. Maybe it's because it's CPanel?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Thu Nov 07, 2002 6:36 pm (15 years, 1 month ago) Reply with QuoteBack to Top

maybe it's 'cause you're using lynx and I checked it in links...

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Thu Nov 07, 2002 6:39 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Daniel wrote:
Just one thing: I would try creating another PHP script which sends a different email and NOT giving out the address :) Then see if it works. If not then I would ask your host.


What does that mean? I don't put a From section?

I tried losing the second dash but that hasn't worked.

Where did you actually get the /usr/local/bin/lynx bit from?

Bill
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Thu Nov 07, 2002 6:51 pm (15 years, 1 month ago) Reply with QuoteBack to Top

/usr/local/bin/lynx is the path to lynx, a web browser.

Quote:

What does that mean? I don't put a From section?


I mean make another copy of the script, and change the subject or something so that you know the email has been sent from the second script. Don't give out the URL, and then see if it works....

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Thu Nov 07, 2002 8:42 pm (15 years, 1 month ago) Reply with QuoteBack to Top

Ok, I did that and when I visited the page it still worked. Do you want me to try and do it now by cron or something?

Is there something else I could do that isn't PHP to actually see if cron jobs are actually working?!
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   


Go to page Previous  1, 2, 3, 4, 5  Next

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.073079 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme