MBCUK
05-02-2012, 02:02 PM
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
// specify url of xml file
$url = "http://xmlfeed.laterooms.com/index.aspx?aid=11657&rtype=4&kword=london";
// get xml file contents
$xml = simplexml_load_file($url);
// loop begins
foreach($xml->hotel as $hotel)
{
// begin new paragraph
echo "<p>";
echo "<img src=".$hotel->images." height=100 width=100><br/>";
echo "<strong>Hotel Name:</strong> ".$hotel->hotel_name."<br/>";
echo "<strong>Hotel City:</strong> ".$hotel->hotel_city."<br/>";
echo "<strong>Prices From:</strong> £".$hotel->prices_from."<br/>";
echo "<strong>Hotel Link:</strong><a href=".$hotel->hotel_link.">click here</a><br/>";
echo "</p>";
// end paragraph
}
// loop ends
?>
</body>
</html>
Hi there, I am trying to create a textbox and button for the user to change the key word on the following line
$url = "http://xmlfeed.laterooms.com/index.aspx?aid=11657&rtype=4&kword=london";
Thankyou for your help in advance
<head>
<title>PHP Test</title>
</head>
<body>
<?php
// specify url of xml file
$url = "http://xmlfeed.laterooms.com/index.aspx?aid=11657&rtype=4&kword=london";
// get xml file contents
$xml = simplexml_load_file($url);
// loop begins
foreach($xml->hotel as $hotel)
{
// begin new paragraph
echo "<p>";
echo "<img src=".$hotel->images." height=100 width=100><br/>";
echo "<strong>Hotel Name:</strong> ".$hotel->hotel_name."<br/>";
echo "<strong>Hotel City:</strong> ".$hotel->hotel_city."<br/>";
echo "<strong>Prices From:</strong> £".$hotel->prices_from."<br/>";
echo "<strong>Hotel Link:</strong><a href=".$hotel->hotel_link.">click here</a><br/>";
echo "</p>";
// end paragraph
}
// loop ends
?>
</body>
</html>
Hi there, I am trying to create a textbox and button for the user to change the key word on the following line
$url = "http://xmlfeed.laterooms.com/index.aspx?aid=11657&rtype=4&kword=london";
Thankyou for your help in advance