WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : What's the weather?
Categories : PHP, Web Services Click here to Update Your Picture
glen mc arthur
Date : Nov 11th 2005
Grade : 3 of 5 (graded 3 times)
Viewed : 3051
File : No file for this code example.
Images : No Images for this code example.
Search : More code by glen mc arthur
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Here's a little script to grab the weather from weather.com using ur zip code and has some basic error handling:

weather.php
<?php

    $defZipCode
= "49341";

   
$IP = getenv("REMOTE_ADDR");
   
exec("whois -h whois.arin.net $IP",$arZipCode);         

    if(
strstr(substr($arZipCode[2],-5),"-")) {
       
$zipCode = intval(substr($arZipCode[2],strlen($arZipCode[2]) - 10, 5));
    } else {
       
$zipCode = intval(substr($arZipCode[2],-5));
    }

    if(
strlen($zipCode) < 5) { $zipCode = $defZipCode; }

   
$url = "http://www.weather.com/weather/us/zips/$zipCode.html";

   
$string = implode("n", file($url));
   
$string2 = explode("<!-- obs include -->", $string);
   
$string3 = explode("<!-- forecast include -->", $string2[1]);
   
$string5 = explode("<CENTER>", $string3[0]);

   
$string4 = explode("<!-- end of obs/fcst table -->", $string3[1]);

   
$currentweather = $string5[0];
     
   
$extforecast = $string4[0];

    echo
$currentweather;
    echo
$extforecast;
?>



file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
Stock quotes from yahoo!
Categories : PHP, Web Services, Arrays
cPanel Subdomains Creator - Create cPanel subdomains without logging into cPanel. Let your visitors create their own subdomains without your intervention. Moreover, it will inform if a subdomain is already exists.
Categories : PHP, Web Services, PHP Classes
Amazon.com API, CURL-REST Parser. Obtain data about Amazon products (PHP5 +)
Categories : PHP, Ecommerce, XML, Web Services, CURL
Simple SOAP Example (with SoapClient)
Categories : PHP, Web Services, SOAP, Beginner Guides
Freshmeat.net XML-RPC - This class is meant to query Freshmeat for information about registered projects.
Categories : PHP, PHP Classes, XML, Web Services
cPanel Email Accounts Creator
Categories : PHP, PHP Classes, Email, Form Processing, Web Services
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Retrieve text from table and email to your e- address in pipe delimited format.
Categories : PHP, MySQL
Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs.
Categories : Databases, PHP, MySQL, Complete Programs
A PHP function to encrypt and decrypt a number or string or a combination of the two.
Categories : PHP, Encryption, Security
Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate.
Categories : Authentication, PHP
PHP Paypal IPN Integration Class v1.0.0
Categories : PHP, PHP Classes, Payment Gateways
Function to remember password
Categories : PHP, Authentication, Personalization and Membership
Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality.
Categories : PHP, GD image library, Graphics