Jump to content

Fergal Andrews

Members
  • Posts

    65
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Fergal Andrews's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Ron_ron Try: for ($i = 0; $i <= 9; $i++) { if ($match[$i] == "H") { $drDisWins++; } }
  2. Hi justlukeyou, If I understand you correctly, this is what you want: <?php $query = "SELECT * FROM productfeed LIMIT 0, 15"; $fetchdata = mysql_query($query) or die("query: $query<br>This has an error: " . mysql_error() . '<br>'); $i = 1; while($row = mysql_fetch_array($fetchdata)) { $id = $row['id']; $image = $row['awImage']; $link = $row['link']; $description = $row['description']; $fulldescription = $row['fulldescription']; $price = $row['price']; echo "<div class='productpagemenu'> <div class='productpagedescription'> <center> <a href='$link' target='_blank' >$description</a> </center> </div> <div class='productpageimage'> <center> <a href='$link' target='_blank'><img src='$image' width=\"95%\"/></a> </center> </div> <div class='productpageprice'> <center> <center>&#38;#163; $price</center> </center> </div> <div class='productpagepricebutton'> <center> <center><a href='$link' target='_blank' ><img src=/images/buybutton.png /></a></center> </center> </div> </div>"; if ($i % 3 == 0) { echo "<br />"; } $i++; } ?> cheers, Fergal
  3. Hi dingleberry, If you just want to put the URL into the form field you could do this: <input type="text" name="url" value="$url" size="30" /> so long as this piece of code is accessible by the code that writes the form. <?php $url="".$_SERVER['HTTP_REFERER']; echo $url; ?> Cheers, Fergal
  4. Hi c_pattle, I wouldn't have all possible URLs in the sitemap. Firstly if there quite a few films in your database you will end up with a huge sitemap. The other reason is that it is possible an automated site map will pick create results for files that you don't want displayed, maybe a backup of another file. Cheers, Fergal
  5. Hi matthew9090, Is the file_get_html() function definitely returning the page HTML? If it is, then you are not assigning the output of strip_tags to anything. Try: $html = strip_tags($html); split() is a deprecated function in php 5.3. Maybe try explode(). Hope that helps, Fergal
  6. Hi mdmartinny, Use unlink (http://www.php.net/manual/en/function.unlink.php). cheers, Fergal
  7. Hi dflow, If you are looking for a MySQL search it would be: SELECT * FROM mytable WHERE mydate BETWEEN '2011-04-17 00:00:00' AND '2011-04-25 23:59:59' cheers, Fergal
  8. Hi anthelo, SELECT tblnews .*, tblnews_categories.* FROM tblnews INNER JOIN tblnews_categories ON table_news.id=tblnews_categories.id cheers, Fergal
  9. Hi stockychaser, glad you got it sorted. All the best, Fergal
  10. Hi stockychaser, Your connection code looks fine. If you're getting a blank page it is probably because error reporting is turned off. Try inserting this at the top of your script: error_reporting(E_ALL); ini_set('display_errors','On'); If you have direct access to the database try running your SQL query directly to make sure it doesn't contain any errors. Fergal
  11. Hi HCProfessionals, This will give you the time difference in minutes. Note that midnight date is 28, not 27 which is today's date as it is midnight tomorrow morning (if that makes sense!). <?php $currentTime = date("Y-m-d h:i:s"); $midnight = strtotime("2011-02-28 00:00:00"); $now = strtotime($currentTime); echo round (abs ($midnight - $now) / 60,2)." minutes"; ?> Cheers, Fergal
  12. Hi rckehoe, If this is only happening with large files it could be due to a timeout error. file_get_contents may not have time to completely read the file before the timeout limit is exceeded. You could try increasing the timeout value in your php.ini file if you have access to it. You could also check if it is a timeout error by only reading a small amount of the file. I'm not sure if this will work with binary data though. $url = 'http://somesite.com/myfile.txt'; $file = fopen($url, "r"); $contents = fgets($file, 100000); //Limits to 100KB fclose($file); If that gets part of the file then I reckon it is a timeout error. Cheers, Fergal
  13. Hi stockychaser, I can't see the country drop-down in the page you link to. Are you definitely getting a connection to your database? Try putting some debugging code in to see if you are getting any results. Use var_dump() to view the content of $obj_queryCarCategory <?php while($obj_queryCarCategory = mysql_fetch_object($result_queryCarCategory)) { var_dump($obj_queryCarCategory); ?> Can you post the code that does the database connection and query? Cheers, Fergal
  14. sorry, should have said, if you have set up php to run from the command line in windows you probably don't need to use wget.
  15. Hi phpmady, If you are on a windows machine you can set up a scheduled task and run the PHP script using wget for windows. http://gnuwin32.sourceforge.net/packages/wget.htm. This calls the script using an http request. http://en.wikipedia.org/wiki/Wget Cheers, Fergal
×
×
  • 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.