Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <script language="javascript" type="text/javascript">
- <!--
- function ajaxFunction(){
- var ajaxRequest;
- try{
- ajaxRequest = new XMLHttpRequest();
- } catch (e){
- alert("Not Supported!");
- return false;
- }
- ajaxRequest.onreadystatechange = function(){
- if(ajaxRequest.readyState == 4){
- var ajaxDisplay = document.getElementById('ajaxDiv');
- ajaxDisplay.innerHTML = ajaxRequest.responseText;
- }
- }
- var nick = document.getElementById('nick').value;
- var queryString = "?nick=" + nick;
- ajaxRequest.open("GET", "filter.php" + queryString, true);
- ajaxRequest.send(null);
- }
- //-->
- </script>
- <form name='myForm'>Nick: <select id='nick' onchange='ajaxFunction()' />
- <option value='all'>All</option>
- <?
- $dbserver = "localhost";
- $dbuser = "xxxxx";
- $dbpassword = "xxxxx";
- $db = "goodtimes";
- mysql_connect($dbserver,$dbuser,$dbpassword);
- @mysql_select_db($db) or die("Unable to connect to database");
- $query = "SELECT DISTINCT name FROM urls WHERE channel='#Goodtimes' order by name asc";
- $result = mysql_query($query);
- $num = mysql_numrows($result);
- mysql_close();
- $i = 0;
- while ($i < $num) {
- $nick = mysql_result($result,$i,"name");
- echo "<option value='$nick'>$nick</option>";
- $i++;
- }
- ?>
- </select>
- <div id='ajaxDiv'></div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement