Jump to content

Recommended Posts

Posted


<?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

  • 9 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.