Jump to content

pontypete

New Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

pontypete's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Guys, this should be something simple, but I keep getting a 500 Internal Server Error each time I visit my website when I upload my htaccess which consists of... RewriteEngine On RewriteRule ^([^/]*)$ /view.php?id=$1 [L] my website is currently getting the id value for database reference, however I want the desired results below: website.com/1 not website.com/view.php?id=1 any help will be great. Thanks in advance! Pete
  2. /* This is the part I need, but is corrupting everything else... $backlinkSources = array(); $result = mysql_query("SELECT website FROM `free_listings`"); while($row = mysql_fetch_assoc($result)) { $backlinkSources[] = $row; } print_r($backlinkSources);*/ $backlinkSources = array ('http://www.safehandsplans.co.uk','http://www.google.com'); $reportArray = array(); $falseFound = false; foreach ($backlinkSources as $source) { $html = file_get_contents ( $source ); $links = ExtractHrefLinks($html); if (CheckForTargetUrl($links, $url) === false) { $falseFound = true; $reportArray[$source] = 0; } else { $reportArray[$source] = 1; } } print_r($reportArray); if ($falseFound === true) { GenerateReportEmail($email, $fromEmail, $subject, $body, $url, $reportArray); } function GenerateReportEmail($email, $fromEmail, $subject, $body, $url, $reportArray) { $header = "From: " . $fromEmail . "\r\n"; foreach ($reportArray as $key => $report) { if ($report == false) { $body .= "Backlink to $url not found on: $key\n"; //update as link 0 $sqlUpdate = "UPDATE free_listings SET backlinkactive='0' WHERE website='$key'"; mysql_query($sqlUpdate) or die (mysql_error()); } } mail($email, $subject, $body, $header); } function CheckForTargetUrl($links, $target) { foreach ($links as $link) { if (strpos($link, $target) !== false) { return true; } } return false; } function ExtractHrefLinks($html) { $dom = new DOMDocument; $linkUrls = array(); @$dom->loadHTML($html); $links = $dom->getElementsByTagName('a'); foreach ($links as $link){ $linkUrls[] = $link->getAttribute('href'); } return $linkUrls; }
  3. And this works... (but I need it feeding in from SQL) $backlinkSources = array ('http://www.safehandsplans.co.uk','http://www.google.com');
  4. $backlinkSources = array(); $result = mysql_query("SELECT website FROM `free_listings`"); while($row = mysql_fetch_assoc($result)) { $backlinkSources[] = $row; } print_r($backlinkSources); Returns these errors: Array ( [0] => Array ( [website] => http://www.safehandsplans.co.uk ) [1] => Array ( [website] => http://www.google.com ) ) Warning: file_get_contents() expects parameter 1 to be string, array given in /home/content/95/9771895/html/checktest.php on line 39 Warning: Illegal offset type in /home/content/95/9771895/html/checktest.php on line 45 Warning: file_get_contents() expects parameter 1 to be string, array given in /home/content/95/9771895/html/checktest.php on line 39 Warning: Illegal offset type in /home/content/95/9771895/html/checktest.php on line 45 Array ( ) Thanks in advance!
  5. $query_rsGetOrderDetails = "SELECT * FROM hd_order WHERE order_by = '$usernameLoggedin' ORDER BY order_id DESC LIMIT 3"; Any ideas?
  6. Hi all, I am wondering what the best way to do this is... Take GoDaddy for example, if your domain is about to expire you will get an automatic email. I am wanting to do something similar, If someone orders a Soap Dispenser, I want to send an email (if they accept to receiving emails on the order) each month asking/reminding them to top up on soap. I have been reading but cant find anything adequate, I have seen something about Cron Jobs, but never heard of this before, please could you point me in the right direction. Thanks in advance. Peter
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.