Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// This is how I am pulling the inforation from the database ///
- <?php
- $dbhost = "localhost";
- $dbuser = "simpsoft_nadmin";
- $dbpass = "ilH5roEL?++A1";
- $dbname = "simpsoft_allnews";
- //Connect to MySQL Server
- mysql_connect($dbhost, $dbuser, $dbpass);
- //Select Database
- mysql_select_db($dbname) or die(mysql_error());
- $artid = "1";
- //build query
- $query = "SELECT * FROM tbl_news_articles WHERE IDone = '$artid'";
- $qry_result = mysql_query($query) or die(mysql_error());
- // Insert a new row in the table for each person returned
- while($row = mysql_fetch_array($qry_result)){
- $display_string .= "<table border='0' class='newsarticletbl'>";
- $display_string .= "<tr style='height:34px;'><td><img src='";
- $display_string .= "$row[IconURL]";
- $display_string .= "' width='42' height='34' alt='article icon' /></td><td valign='top'><h5>";
- $display_string .= "$row[SmallHeader]";
- $display_string .= "</h5><p class='newsarticledate'>Date Posted - ";
- $display_string .= "$row[DatePosted]";
- $display_string .= "</p></td></tr>";
- $display_string .= "<tr><td colspan='2' valign='top'><p class='newsarticletxt'>";
- $display_string .= "$row[SmallPar]";
- $display_string .= "<a href='#' style='color:#b40101;margin-left:4px;'><del>Read More</del></a>";
- $display_string .= "</p></td></tr></table>";
- $display_string .= "<img src='/images/article_sep.gif' width='130' height='2' alt='article sep' class='articlesep' />";
- }
- echo $display_string;
- ?>
- /// This is how I am calling it into my HTML ///
- <script type="text/javascript">
- <!--
- //Browser Support Code
- function ajaxFunction(){
- var ajaxRequest; // The variable that makes Ajax possible!
- try{
- // Opera 8.0+, Firefox, Safari
- ajaxRequest = new XMLHttpRequest();
- } catch (e){
- // Internet Explorer Browsers
- try{
- ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try{
- ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e){
- // Something went wrong
- alert("Your browser broke!");
- return false;
- }
- }
- }
- // Create a function that will receive data sent from the server
- ajaxRequest.onreadystatechange = function(){
- if(ajaxRequest.readyState == 4){
- var ajaxDisplay = document.getElementById('ajaxDiv');
- ajaxDisplay.innerHTML = ajaxRequest.responseText;
- }
- }
- ajaxRequest.open("GET", "/inclu/news.php");
- ajaxRequest.send(null);
- }
- //-->
- </script>
- <div id='ajaxDiv'></div>
- Basically I want to know how I can pass a variable
Add Comment
Please, Sign In to add comment