<form method="POST" action="" > <label for="Feed_element"> Posting a feed </label> <select id="combo" name="Make" onchange="document.getElementById('add_text').value=this.options[this.selectedIndex].text"> <option value= "$url">Search for articles</option> <option value="">RSS-1</option> <option value="2">RSS-2</option> <option value="3">RSS-3</option> </select> <input type="hidden" name="add_text" id="add_text" value="" /> <input type="submit" name="search" value="Search" /> </form> <?php if (isset($_POST['search'])) { $makerValue = $_POST['Make']; // make value $maker = mysql_real_escape_string($_POST['add_text']); // get the selected text echo $maker; } $html = ""; // URL containing rss feed $url = "https://www.feedforall.com/sample.xml"; $xml = simplexml_load_file($url); for ($i = 0; $i < 1; $i++) { $title = $xml->channel->item[$i]->title; $link = $xml->channel->item[$i]->link; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; $html .= "<a href='$link'>$title</a>"; // Title of post $html .= "$description</br>"; // Description $html .= "<br />$pubDate<br /><br />"; // Date Published } echo "$html<br/>"; ?>
<select id="combo" name="Make" onchange="document.getElementById('add_text').value=this.options[this.selectedIndex].text">
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)