Jump to content

rnmcd

Members
  • Posts

    464
  • Joined

  • Last visited

Everything posted by rnmcd

  1. I was so close at one point...I had originally tried a directory path: /home/cpanelName/admin/runcron.php ---- but missed the 'public_html' So close but yet so far... But with your help we were able to get this figured out!!!! I truly appreciate your time David. Thank you for sticking with me for the last couple of days as I trudged through this.
  2. By the way, here is the output that I get when I go to http://www.MYwebsite.com/admin/runcron.php: is that what I should see?
  3. Do you think the problem could be that there is not a PHP CGI/CLI binary on my server? Is there a way I can check?
  4. Nuts! I thought we had it. I had already changed the first line of the runcron.php script to: >#!/usr/bin/php When I added the 'missing' "L" to null I'm back to getting this email error message: >/bin/sh: line 1: http://www.[I]MYwebsite[/I].com/admin/runcron.php: No such file or directory
  5. Here is the email message I am receiving after running my cron job with the change we have discussed: I am 100% sure that the file runcron.php is in the admin folder. Hmm. EDIT: I have since added: > /dev/nul to the end of cron command--I wasn't sure that it would be required. My NEW email error message after including > /dev/nul is: I am sure the permissions on the runcron.php file is 755. What should it be for the expire.php file or does that matter?
  6. Believe it or not, I actually used the correct URL! does it matter if there are single-quotes or double-quotes on each end of the URL?
  7. I'm laughing because I know so little Is this all of the code that would need to be in the runcron.php file that MikeJ suggested? >#!/usr/local/bin/php <?php include('http://indiemanagers.com/amember/cron.php'); ?> What does the '#!/usr/local/bin/php' do?
  8. Here is TCH-MikeJ's suggestion: I think I have a basic understanding of TCH-MikeJ's suggestion. But the quandry is with my web developer. I showed him the code MikeJ listed and my web developer said that it would not work on my TCH hosted site because "the method described is for running cron when php is installed in cgi mode. PHP is not installed in CGI mode on your site." Is he correct in this?
  9. I am looking into the method you suggested via TCH-MikeJ. But what could cause those error messages when the php script will run fine if I access the respective file? Is it due to the cron command?
  10. The cron job ran and I recieved the following email: (I removed my cpanel_username) It doesn't look like the expire.php script ran properly. Does the email provide any clues to what may have went wrong?
  11. How do I run the cron command immediately? Do I just change the scheduled run to everyminute?
  12. So are you saying that if there are not any problems with includes then the script may run properly with cron command: >php -q /home/cpanelName/public_html/admin/expire.php > /dev/null May I ask what might make you think the includes could be the problem? I was under the impression that the problems were due to 'lynx' no longer being available for cron jobs. I also assumed (oops) that some change would need to be made to the script since I would no longer be using lynx.
  13. I previously had a php script that ran from this cron job: lynx -dump http://www.mywebsite.com/admin/expire.php > /dev/null I learned that: TCH-David also mentioned that the php script could be run with this command in a cron job: >php -q /home/cpanelName/public_html/admin/expire.php > /dev/null Can anyone assist me with the changes that would need to be made to the following php script in order for it to run properly using the above cron job command? ><?PHP include("../include/common.php"); $sql="SELECT ".$config[table_prefix]."listingsDB.ID, ".$config[table_prefix]."listingsDB.expiration, ".$config[table_prefix]."UserDB.emailAddress, ".$config[table_prefix]."UserDB.user_name FROM ".$config[table_prefix]."listingsDB,".$config[table_prefix]."UserDB WHERE ".$config[table_prefix]."listingsDB.user_id=".$config[table_prefix]."UserDB.ID"; $recordSet=$conn->Execute($sql); while (!$recordSet->EOF) { $ID=make_db_unsafe($recordSet->fields[ID]); $expire=$recordSet->fields[expiration]; $email=make_db_unsafe($recordSet->fields[emailAddress]); $name=make_db_unsafe($recordSet->fields[user_name]); $expyear=substr($expire,0,4); $expmon=substr($expire,6,2); $expday=substr($expire,8,2); $test1=mktime(0,0,0,$expmon,$expday,$expyear); $year= date(Y); $mon=date(m); $day=date(d)+5; //variable for how many days before exp to send email $test=mktime(0,0,0,$mon,$day,$year); $year1=date(Y); $mon1=date(m); $day1=date(d)-10; //variable for how many days after expiration to delete $test2=mktime(0,0,0,$mon1,$day1,$year1); if ($test==$test1) { global $config, $lang; $message = $_SERVER[REMOTE_ADDR]. " -- ".date("F j, Y, g:i:s a")."\r\n\r\nHello $name,\r\n\r\n This is a reminder that your listing # $ID will expire on $expire and will no longer be visible. You may access your account (to renew, edit, or delete your ad) at this link: $config[baseurl]/admin/edit_my_listings.php?edit=$ID.\r\n\r\nExpired ads will be removed from your account 10 days after expiration.\r\n"; $header = "From: ".$config['admin_email']." <".$config['admin_email'].">\r\n"; $header .= "X-Sender: $config[admin_email]\r\n"; $header .= "Return-Path: $config[admin_email]\r\n"; mail("$email", "Listing Expiration", $message, $header); } if ($test1<=$test2) { echo $ID." ".$test."<br>".$test2."<br><br>"; $sql2="DELETE FROM ".$config[table_prefix]."listingsDB WHERE ID=$ID"; $rs=$conn->Execute($sql2); $sql3="DELETE FROM ".$config[table_prefix]."listingsDBElements WHERE listing_id=$ID"; $rs2=$conn->Execute($sql3); $sql = "SELECT file_name, thumb_file_name FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $ID)"; $rs3 = $conn->Execute($sql); if ($rs3 === false) { log_error($sql); } while (!$rs3->EOF) { $thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]); $file_name = make_db_unsafe ($recordSet->fields[file_name]); if (!unlink("$config[listings_upload_path]/$file_name")) { die("$lang[alert_site_admin]"); } if ($file_name != $thumb_file_name) { if (!unlink("$config[listings_upload_path]/$thumb_file_name")) { die("$lang[alert_site_admin]"); } } $rs3->MoveNext(); } $sql = "DELETE FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $ID)"; $rs4 = $conn->Execute($sql); if ($rs4 === false) { log_error($sql); } } $recordSet->MoveNext(); } $sql5="SELECT ID, creation_date FROM ".$config[table_prefix]."listingsDB WHERE active='no'"; $rs5=$conn->Execute($sql5); while (!$rs5->EOF) { $ID=$rs5->fields[ID]; $creation=$rs5->fields[creation_date]; $expyear=substr($creation,0,4); $expmon=substr($creation,6,2); $expday=substr($creation,8,2); $test4=mktime(0,0,0,$expmon,$expday,$expyear); $year1=date(Y); $mon1=date(m); $day1=date(d)-5; //variable for how many days after creation but not active to delete $test5=mktime(0,0,0,$mon1,$day1,$year1); if ($test4<=$test5) { $sql12="DELETE FROM ".$config[table_prefix]."listingsDB WHERE ID=$ID"; $rs=$conn->Execute($sql12); if ($rs === false) { log_error($sql12); } $sql13="DELETE FROM ".$config[table_prefix]."listingsDBElements WHERE listing_id=$ID"; $rs2=$conn->Execute($sql13); $sql14 = "SELECT file_name, thumb_file_name FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $ID)"; $recordSet = $conn->Execute($sql14); if ($recordSet === false) { log_error($sql14); } while (!$recordSet->EOF) { $thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]); $file_name = make_db_unsafe ($recordSet->fields[file_name]); if (!unlink("$config[listings_upload_path]/$file_name")) { die("$lang[alert_site_admin]"); } if ($file_name != $thumb_file_name) { if (!unlink("$config[listings_upload_path]/$thumb_file_name")) { die("$lang[alert_site_admin]"); } } $recordSet->MoveNext(); } $sql15 = "DELETE FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $ID)"; $recordSet = $conn->Execute($sql15); if ($recordSet === false) { log_error($sql15); } } $rs5->MoveNext(); } ?>
  14. So since that command doesn't open up a browser to run the script is that why I don't need a URL? By the way, what directory is '/home/' ? Is that the actual directory name? I would definitely prefer not to have another script written unless it is necessary, which, from your comments, doesn't sound like it is. Also, is there any way to see if a cron job was executed? Does cPanel have a way to check or could there be another way?
  15. I talked to my developer and he isn't familiar with other methods to run a php file as a cron job. So I'll have to start by asking the most basic questions here because I'm more novice than he is! Since lynx is not available, will the script that I need still be run through a cron job but without opening a browser. OR will a different non-cron job dependent script need to be written?
  16. Very Very informative! Thank you.
  17. I see that part/all of my problem is that the script I am using uses 'lynx' which is no longer available. If a script that uses 'lynx' be re-written to do the same thing without 'lynx'? Also, would there typically be an error message when using a non-supported 'lynx'?
  18. Here is the command: lynx -dump http://www.fsboiowa.com/admin/expire.php >> /dev/null any idea what I need to check to see why this isn't running? The person that is developing the site for me said that the "script does work because I just accessed it directly and it removed the listings." I don't understand what he means by 'directly accessing it' but I have sent an email to him to find out. Thanks.
  19. I just pasted: INSERT INTO default_listingsDB (ID) VALUES (1111) DELETE FROM default_listingsDB WHERE ID = 1111 into the box in the sql tab and clicked 'go'. Phpmyadmin displayed: Any idea what the SQL syntax may be? Thank you.
  20. The person that is helping me design a web site asked me to go into phpmyadmin and enter the following two queries in the 'sql' tab: >INSERT INTO default_listingsDB (ID) VALUES (1111) DELETE FROM default_listingsDB WHERE ID = 1111 Does anyone know what these queries will do?
  21. I don't know what a cron job is exactly but the person that is helping me develop my sites told me to copy the cron job on one of my sites to the other site...is CPanel the only way to do that? Thanks!!
  22. I added: >RewriteEngine on RewriteRule ^([0-9]+)/?$ listingview.php?listingID=$1 RewriteCond %{HTTP_HOST} ^gotoad\.com$ RewriteRule ^(.*)$ http://www.gotoad.com/$1 [R=301,L] to the .htaccess file and it works!! Thanks folks!
  23. Weird that GroovyFish and I, using the same IE browser version, both get the error. I wouldn't have thought that relatively similair IE browser versions would function so differently.
  24. Bruce, are you using the same version as Thomas?
  25. It's still not working for me. what was the displaying as the URL when you were able to get the menus to work? Also which version of IE are you using? I'm using 6.0.2800.1106 Thanks.
×
×
  • Create New...