HI guys i have been givin this code from a website to put on my website all is good with the code but this is what i want to know but first of all here is the code
I would like to show moew then an image and how hot it is i would like to show the follwoingCode:<?php if (!$accid) { $accid="USWA0395"; } $url ="http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=$accid"; # Use cURL to get the page $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $CurlContent = curl_exec ($ch); curl_close ($ch); # Look for fieldnames, set into $WeatherFields array $FieldPattern = '|this.sw([^\s]+) = |'; preg_match_all($FieldPattern, $CurlContent, $WeatherFields); # Parse data into hash foreach ($WeatherFields[1] as $WeatherField) { $FieldSpec = '|this.sw' . $WeatherField . ' = "([^\"]+)|'; preg_match($FieldSpec, $CurlContent, $WeatherData); $MsnWeather[$WeatherField] = $WeatherData[1]; } # If the temp is N/A... if($MsnWeather[Temp] == "N/A"){ $notavailabletemp = "1"; } if ($MsnWeather['CIcon']=="" OR $MsnWeather['CIcon']=="NULL") { $MsnWeather['CIcon'] = 44; } $MsnWeather['Temp'] = $MsnWeather['Temp']-32; $MsnWeather['Temp'] = $MsnWeather['Temp']/9; $MsnWeather['Temp'] = $MsnWeather['Temp']*5; $MsnWeather['Temp'] = round($MsnWeather['Temp'], 0); print "<img align=\"absmiddle\" border=\"0\" src=\"http://st.msn.com/as/wea3/i/en-US/saw/". $MsnWeather['CIcon'] . ".gif\"> <a href=\"http://weather.msn.com/local.aspx?wealocations=wc:$accid\">". $MsnWeather['Temp'] ."°C</a>"; ?>
Please have a look at this site , this is where all the php gets the code from http://www.msnbc.com/m/chnk/d/weathe...?acid=USWA0395
I would like to show the wind speed and derection, i would like to be able to show the Barometer, Dewpoint, Humidity, Visibility: Sunrise, Sunset:
infact it would be cool if i could some how show the information on MSN at this address
http://weather.msn.com/local.aspx?we...ns=wc:ASXX0112
Now this is the catch i would like to request bits and parts of this code for different pages. so instead of have 5 different php pages all going to one i would like to use the print fuction to somehow make 1 php page but show it on many php pages. for e.g. i DON'T want to show the wind on the first page it you go to http://www.queerfmnews.com then click on weather you will see what i mean.
But when someone clicks on there city or reqeust there city they see all the information layed out in another php page.
This is what i am using at the moment to show the information on another page
i would like to be able to use a different fution or the same but show different parts of the code.Code:<?php include("http://www.queerfmnews.com/newwebsiteweather/weather/weathercode/USDC0001.php"); ?>
Is this possible
Thanks



Reply With Quote
Bookmarks