Jump to content

Aleroth

New Members
  • Posts

    4
  • Joined

  • Last visited

Aleroth's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi there, I want to create like a online interaction system on my site. you know like a "Chat to us now" kinda thing. Where when a user is on your site you can chat with them directly from the home page or any other page using a 3rd party software like Pidgin, but the user uses the site to reply. I found some awesome 3rd party plugins to use, but you have to pay like per month on all of them, and i can't afford that right now. now i found a free one to use, but has loads of limitations, its called Olark. It works perfectly, but like i said, you have limitations. I want to create my own, im just not sure what to look for, does anybody have an idea where i can look for like tutorials on how or some open source thing i can look into. Please, and thank you.
  2. Makes sense, but if i do that the info just displays like this : 1 2 3 4 1 2 3 4 1 2 3 4 and i want it to display it like this: 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 this is the code i added after your reply: while($row = mysql_fetch_array($result, MYSQL_NUM)) { foreach($row as $value) { $content .= "$value<br>"; } }
  3. Hi there, Now i have a bunch rows in a SQL Database that i want to have displayed in a table but each rows info must be displayed in a column, for example the rows has data like this: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 so, lets say there is 3 rows it should display it like this : 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 this is the code i have so far: $query = "SELECT 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 FROM info ORDER BY id"; $result = mysql_query($query) or die('Error : ' . mysql_error()); $content = "<table>"; //code goes here, i guess it will be some kind of foreach loop or something $content .= "</table>"; echo $content; I guess it will be a foreach loop i guess, i know how to work with the while loop but then it creates a column below each other and not next to each other. Help Please...Thank u
  4. Problem with Auto-complete Styling in JQuery Hi there, I think i should ask this question here, if not...I Apologize. Okay here goes: I have a Country/City list in my SQL database and access it with PHP using a select element in php. I use the Chosen Jquery Plugin for the styling of these select elements. Now my problem is that i want only the cities of the country selected to display, and i got that right, but then when it loads the city list, it discards the Chosen Style to the select element. To load my City Select data i use the onChange event. here is the code: function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getCity(strURL) { var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('citydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } that is the Javascript i use to load the file combined with this: <select name="country" id="country" data-placeholder="Choose a Country..." class="chzn-select-deselect" onChange="getCity('findcity.php?country='+this.value)"> You can view the Chosen Plugin details here - http://harvesthq.github.com/chosen/ the PHP file "findcity.php" looks like this: <?php include 'connection.php'; $query = "SELECT fips, full_name FROM cities WHERE fips='$country' ORDER BY full_name"; $getCity = mysql_query($query) or die('Error : ' . mysql_error()); include 'closedb.php'; ?> <select name="city" id="city" data-placeholder="Choose a City..." class="chzn-select-deselect"> <option selected="selected"></option> <?php while ($row = mysql_fetch_array($getCity)) {?> <option value="<?php echo $row2['full_name']; ?>"> <?php echo $row['full_name']; ?></option> <?php } ?> </select> Now it works fine, when you select the country it shows the city list fine. But it doesn't have the Chosen Style like the country does. it has all the class's it needs added etc. but yet nothing. Its like the Ajax loading makes the select element loose the class added to it. Is there a way of preventing this or maybe adding the class again after it loaded?
×
×
  • Create New...