phpguru Posted August 29, 2012 Report Posted August 29, 2012 <?php $query = htmlentities( $_POST["query"] ) ; if ( $query != "" ) { echo "<center>\n" ; echo "<h1>[" . ucwords( $query ) . "]</h1>\n" ; echo "</center>\n" ; $ch = curl_init() ; $array = array( CURLOPT_URL => "http://inbuzunar.mobi/meteo.php", CURLOPT_HEADER => 0, CURLOPT_FRESH_CONNECT => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => "query=" . $query ) ; curl_setopt_array( $ch, $array ) ; $curl = curl_exec( $ch ) ; curl_close( $ch ) ; preg_match_all( '/<div\sclass=\"nolink\">(.+?)<\/div>/si', $curl, $matches ) ; $totl = count( $matches[1] ) ; for ( $i = 0; $i < $totl; $i++ ) { echo "<p>" ; echo $matches[1][$i] ; echo "</p>\n" ; } } echo "<center>\n" ; echo "<form action=\"" . htmlentities( $_SERVER["PHP_SELF"] ) . "\" method=\"post\">\n" ; echo "<input type=\"text\" name=\"query\" maxlength=\"35\" value=\"Sat/Comuna/Oras\" onfocus=\"if(this.value=='Sat/Comuna/Oras')this.value=''\" onblur=\"if(this.value=='Sat/Comuna/Oras')this.value=''\"/>\n" ; echo "<input type=\"submit\" value=\"Cauta\"/>\n" ; echo "</form>\n" ; echo "</center>\n" ; ?> DEMO: http://inbuzunar.mobi/meteo.php Pasnic si..simplu
phpguru Posted June 8, 2013 Author Report Posted June 8, 2013 Va anunt cu placere ca InBuzunar.Mobi a devenit www.tastez.ro Pasnic si..simplu
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now