Jump to content

ldoozer

Members
  • Posts

    117
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ldoozer's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Thanks jim_keller, your solution fixed the issue: it's probably a timezone difference between where you are and where the server is. Try calling date_default_timezone_set( 'your timezone here' ) early in your code, but replace 'your timezone here' with a valid timezone from this list: http://us3.php.net/manual/en/timezones.php
  2. I have checked the server time setting and shows the correct time, date and GMT +00 London zone. Is this relevant to your last post?
  3. If i write the date to a date(type=date) field in the mysql database it stores the correct date. However when returning the unix date using php code any date before the end of November 2010 outputs the day before the date that is in the database. Is this something to do with clocks changing, or the servers time? Any one else seen anything similar?
  4. I am using a standard form to mail script and have a few fields that I need to be required to be filled in. This is working fine until someone enters a space character in a required field, which is being let thorugh. How can I stop this? here the code for required fields - I thought the trim function in the below would have taken care of this??? // This is because I originally had it require but too many people // were used to Matt's Formmail.pl which used required instead. if ($required) $require = $required; // handle the required fields if ($require) { // seperate at the commas $require = ereg_replace( " +", "", $require); $required = split(",",$require); for ($i=0;$i<count($required);$i++) { $string = trim($required[$i]); // check if they exsist if((!(${$string})) || (!(${$string}))) { // if the missing_fields_redirect option is on: redirect them if ($missing_fields_redirect) { header ("Location: $missing_fields_redirect"); exit; } $require; $missing_field_list .= "<b><font color=\"#990000\">Missing: $required[$i]</font></b><br>\n"; } } // send error to our mighty error function if ($missing_field_list) print_error($missing_field_list,"missing"); }
  5. Can anyone tell me how to parse one of the child elements in the xml below.I have accesses title,link and description using the following php, but I need to access the image width for example which is a child element.Please help!echo '<ul>';foreach ( $items as $item ) {$href = $item['link'];$title = $item['title'];$img = $item['description'];echo "<li><a href=$href>" . $img . "</a></li>";}echo "</ul>"; <item> <title>DSC00071</title> <link> <description><p><a href="http://www.flickr.com/people/53764782@N08/">SteveDupree</a> posted a photo:</p> <p><a href=" title="DSC00071"><img src="http://farm5.static.flickr.com/4149/4964530050_c51dc91b8f_m.jpg" width="240" height="180" alt="DSC00071" /></a></p></description> <pubDate>Mon, 06 Sep 2010 10:05:19 -0700</pubDate> <dc:date.Taken>2007-08-08T11:01:16-08:00</dc:date.Taken> <author flickr:profile="http://www.flickr.com/people/53764782@N08/">nobody@flickr.com (SteveDupree)</author> <guid isPermaLink="false">tag:flickr.com,2004:/photo/4964530050</guid> <media:content url="http://farm5.static.flickr.com/4149/4964530050_54c8625a59_o.jpg" type="image/jpeg" height="1224" width="1632"/> <media:title>DSC00071</media:title> <media:thumbnail url="http://farm5.static.flickr.com/4149/4964530050_c51dc91b8f_s.jpg" height="75" width="75" /> <media:credit role="photographer">SteveDupree</media:credit> </item>
  6. Can any one tell me how to access the image of this xml file: <item> <title>DSC00083</title> <link>http://www.flickr.com/photos/53764782@N08/4963929579/</link> <description><p><a href="http://www.flickr.com/people/53764782@N08/">SteveDupree</a> posted a photo:</p> <p><a href="http://www.flickr.com/photos/53764782@N08/4963929579/" title="DSC00083"><img src="http://farm5.static.flickr.com/4111/4963929579_3334de3f06_m.jpg" width="240" height="180" alt="DSC00083" /></a></p></description> <pubDate>Mon, 06 Sep 2010 10:05:37 -0700</pubDate> <dc:date.Taken>2007-08-08T19:30:20-08:00</dc:date.Taken> <author flickr:profile="http://www.flickr.com/people/53764782@N08/">nobody@flickr.com (SteveDupree)</author> <guid isPermaLink="false">tag:flickr.com,2004:/photo/4963929579</guid> <media:content url="http://farm5.static.flickr.com/4111/4963929579_cf0b5e5656_o.jpg" type="image/jpeg" height="1224" width="1632"/> <media:title>DSC00083</media:title> <media:thumbnail url="http://farm5.static.flickr.com/4111/4963929579_3334de3f06_s.jpg" height="75" width="75" /> <media:credit role="photographer">SteveDupree</media:credit> </item> I am retereiving the title and the href with this: //print_r ($rss); echo '<ul>'; foreach ($rss->items as $item) { $href = $item['link']; $title = $item['title']; $img = $item['?????????']; echo "<li><a href=$href>" . $img . "</a></li>"; } echo "</ul>"; ?> but cant seem to get at <media:content url="http://farm5.static.flickr.com/4111/4963929579_cf0b5e5656_o.jpg" type="image/jpeg" height="1224" width="1632"/>
  7. I am trying to pull in the latest Flickr images from my account and using magpierss to parse the feed. I am successfully creating a ul list of the images using the code below, but I cannot see how to size the images, can anyone help. The $item['description']; line produces: Username posted a photo: FlickrImage <? require_once 'magpierss/rss_fetch.inc'; $url = ''; $rss = fetch_rss( $url ); echo '<ul>'; foreach ($rss->items as $item) { $href = $item['link']; $title = $item['title']; $img = $item['description']; echo "<li><a href=$href>" . $img . "</a></li>"; } echo "</ul>"; ?>
  8. I am trying to validate a field to see if its empty or not and using: if(strlen($company)<1){ this works fine but if someone adds a space character it lets is through. Is there a way to catch this?
  9. removed quotes and working great - thanks for your support
  10. Thanks v much - I have used it like this below... but now its returning Thursday 1st January 1970 for every post. I am a complete novice so sorry for my ignorance. <?php define('MAGPIE_DIR', 'magpie/'); require_once(MAGPIE_DIR.'rss_fetch.inc'); $num_items = 10; $rss = fetch_rss( 'http://care4air.blogspot.com/rss.xml' ); print_r(); $items = array_slice($rss->items, 0, $num_items); //display latest blog content: foreach ($items as $item) { $published = $item['published']; $content = $item['atom_content']; //$author = $item['author_name']; $fDate = date('l jS F Y',strtotime('$published')); echo "<h2 id=\"news_story\">$fDate</h2>\n"; echo "<p>$content</p>\n"; //echo "<p>$author</p>\n"; echo "<hr />\n"; } ?>
  11. I have read these pages and used them in the past to format mysql date format but this hasn't helped me for this problem - can anyone write the code and talk it through?
  12. I have retrieved a date from a blogger feed using magpierss and am returning 2009-03-02T14:19:00.003Z as the date. Can anyone help in converting this to Monday 2nd March 2009.
  13. Thanks for the reply Is there a problem with that though because it could return both S2 and S22?
  14. Hi all I am trying to develop a small postcode lookup so taht people can type in their full postcode and hit go, and they are send to a page where they see the results to see if something is happening in their area. The problem is I only want to query the first part of the postcode i.e. S10 or S1 and disregard the rest. I have a script that will format the input from the user to a standard format (http://www.braemoor.co.uk/software/postcodes.shtml) but what i need to know is how to query there database form there: Would it be something like: $query = "SELECT * FROM tablename WHERE LEFT(PostCode, LENGTH(PostCode ) - 3 )IN('$postcode')"; Many thanks Steve
  15. my website was hacked recently and I found that my htaccess file had been modified to include something that said if coming from google go to another page. I was thinking I could use something similar and send people to a page that has the redirect message and then have a meta redirect on that page to get them to the site, can you see a problem with this idea?
×
×
  • 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.