talevtehnology
Registered
Здравейте ,как да свържа падащото меню със php кода :?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>vremeto</title>
</head>
<SELECT name="selectcity" id="selectcity" onchange="$target_url =([this.selectedIndex])" style="width:100px; height:18px; font-size:11px; margin-left:5px; vertical-align:middle;">
<OPTION value="http://sinoptik.bg/?lid=100728193">Пловдив</OPTION> <OPTION value="http://sinoptik.bg/?lid=100727011">София</OPTION> <OPTION value="http://sinoptik.bg/?lid=100726050">Варна</OPTION> </SELECT>
<?
$target_url = "http://sinoptik.bg/?lid=100728193";
$connect = file_get_contents($target_url);
$city = explode("<td class=\"city\" height=\"39\" nowrap style=\"padding-top:10px;\"><b>", $connect);
$city = explode("</b>", $city[1]);
$city = iconv('utf-8','windows-1251',urldecode($city[0]));
$temp1 = explode("<div id=\"temperature2\" class=\"fill\"><b>", $connect);
$temp1 = explode("</b>", $temp1[1]);
$temp1 = iconv('utf-8','windows-1251',urldecode($temp1[0]));
$temp2 = explode("<div id=\"condition2\" class=\"fill\"><b>", $connect);
$temp2 = explode("</b>", $temp2[1]);
$temp2 = iconv('utf-8','windows-1251',urldecode($temp2[0]));
$uset = explode("<b id=\"feelslike\" class=\"f24\">", $connect);
$uset = explode("</b>", $uset[1]);
$uset = iconv('utf-8','windows-1251',urldecode($uset[0]));
echo "A?aa: <B>$city</B>";
echo "<Br />";
echo "Oaiia?aoo?a: <B>$temp1, $temp2</B>";
echo "<Br />";
echo "Onaua na eaoi <B>$uset</B>";
?>
<body>
</body>
</html>
Към всеки град е и неговото URL което трябва да сменям чрез менюто $target_url = "http://sinoptik.bg/?lid=100728193";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>vremeto</title>
</head>
<SELECT name="selectcity" id="selectcity" onchange="$target_url =([this.selectedIndex])" style="width:100px; height:18px; font-size:11px; margin-left:5px; vertical-align:middle;">
<OPTION value="http://sinoptik.bg/?lid=100728193">Пловдив</OPTION> <OPTION value="http://sinoptik.bg/?lid=100727011">София</OPTION> <OPTION value="http://sinoptik.bg/?lid=100726050">Варна</OPTION> </SELECT>
<?
$target_url = "http://sinoptik.bg/?lid=100728193";
$connect = file_get_contents($target_url);
$city = explode("<td class=\"city\" height=\"39\" nowrap style=\"padding-top:10px;\"><b>", $connect);
$city = explode("</b>", $city[1]);
$city = iconv('utf-8','windows-1251',urldecode($city[0]));
$temp1 = explode("<div id=\"temperature2\" class=\"fill\"><b>", $connect);
$temp1 = explode("</b>", $temp1[1]);
$temp1 = iconv('utf-8','windows-1251',urldecode($temp1[0]));
$temp2 = explode("<div id=\"condition2\" class=\"fill\"><b>", $connect);
$temp2 = explode("</b>", $temp2[1]);
$temp2 = iconv('utf-8','windows-1251',urldecode($temp2[0]));
$uset = explode("<b id=\"feelslike\" class=\"f24\">", $connect);
$uset = explode("</b>", $uset[1]);
$uset = iconv('utf-8','windows-1251',urldecode($uset[0]));
echo "A?aa: <B>$city</B>";
echo "<Br />";
echo "Oaiia?aoo?a: <B>$temp1, $temp2</B>";
echo "<Br />";
echo "Onaua na eaoi <B>$uset</B>";
?>
<body>
</body>
</html>
Към всеки град е и неговото URL което трябва да сменям чрез менюто $target_url = "http://sinoptik.bg/?lid=100728193";