After long searching of comet server, i choose orbited comet server.
I have to build a real-time chat system in PHP using Orbited Comet Server and Stomp PHP client.
It does not handle hundreds or thousands of simultaneous connections.
How could i solve this problem? Is there any other library to add for fix this problem?
Thanks.
M...
Hello everyone!
I need to generate two numbers that are NOT equal in PHP.
I know that I use $random1 = (rand()%9); to generate random a number between 0-9. I need to add something to this I guess.
Thanks!
...
I'm relatively well versed in designing websites. I mostly go for LAMP where I already have a small "framework" of my own, that I use. In short, it separates the logic from the layout and I have basically one logic file to one or many layout files depending on what views are supported in the layout. There's an admin section and there are...
Sorry for duplicating this question, but here I tried to explain it in more details.
I need to parse the data from certain file and store it to database (MySQL). This is how the data is displayed in the file:
戚谊
戚誼
[m1][b]qīyì[/b][/m]
[m2]translation 1[/m]
[m1][b]qīyi[b][/m]
[m2]translation 2[/m]
三州府
[m1][b]sā...
Hi,
I currently have two classes, one called Dog, one called Poodle. Now how can I use a variable defined in Dog from the Poodle class. My code is as follows:
class dog {
protected static $name = '';
function __construct($name) {
$this->name = $name
}
}
class Poodle extends dog {
functi...
string could be anything @username is the link in multi-line string.. we need to link the @username anywhere in the url.. just like twitter
$text = preg_replace('!(^|\W)@(([a-z0-9]+(\.?[-_a-z0-9]+)*)+)!', '\\1<a href="http://$2.'.site::$domain_only.'">@$2</a>', $text);
its my php version.. how can i convert it or use...
function sitemap_galerija($tablica)
{
require("include/konekcija.php");
if($tablica == 'kategorije')
{
// Connect do database
...
while($row = mysql_fetch_array($sql_result))
{
$kategorija['naziv'][] = $row["naziv"];
$kategorija['naziv_url'][] = $row["naziv_url"];
}
return $kat...
I have a web application written in PHP. It uses MySQL for data storage. Today I decided to profile it to find bottlenecks in code and find which parts of it are running slower that the others. The usual stuff. I did a lot of work and now my page loads in less than 0.05 seconds on my desktop.
But now my profiler tells me that half of th...
Can anyone show me the way or provide some good links to read in order to
send hotel availability from a reservation system to GDS networks - expedia booking.com
Do i have to make something like a xml file?
Any API available in php?
thanks for any hint-help!!!
...
Hey!
I have a table that has 5 fields and has a total of 400 records. I added a new field which I called 'order' which, as the name suggests, is to keep an order in the records.
Since I added this after the records had been inserted I was wondering if there was a way to populate this field with the current order of the records using so...
We need to generate a cryptographically random string to use as an authentication token, which will be tied to session data in the database. We are using PHP, which doesn't appear to have a suitable random number generator built-in. How can we generate a cryptographically secure random string of N length using php?
Also note, due to t...
$str = "This is a string containing 中文 characters. Some more characters - 中华人民共和国 ";
How do I detect chinese characters from this string and print the part which starts with the first character and ends with "-"? (it would be "中文 characters. Some more characters -").
Thank you!
...
i want to display image after it upload
i write following code but it did't work
onFileSuccess: function(file, response) {
var json = new Hash(JSON.decode(response, true) || {});
if (json.get('status') == '1') {
file.element.addClass('file-success');
} else {
file.element.addClass('file-failed');
}
})
and li is
...
i have a following feed from twitter and im making all links clickable and then i want that links which are inside a tag to be short to 30 chars, if its more then 30 chars then show ... after 30 chars
twitter feed
i need to start learning some real javascript from http://javascript.com/java/codes/snippet/search?q=javascript+limit+ch...
Hello,
ive got a user class where i can get the name, date of birth etc of the user... (below)
class user {
private $id;
private $name;
private $dob;
private address;
function __construct($id) {
$this->id = $id
}
}
i was just wondering what the best practice to get all users. do i create a function...
I am trying to change the HTML that is output when I print $search_box in my page.tpl.php file. I understand the process of overriding something in drupal but I have no idea how to do it for the search box.
This is the only bit of information that I have found that seems related but I don't known how to apply it to solving my problem: h...
I'm trying to extend PHP Markdown to allow the use of {{ and }} around some parts of the text (they will become search keywords, like a tag).
I have this basic regex that kinda works:
preg_match_all("/\{\{(.*)\}\}/", $description, $nomsTags);
Except it doesn't work when there are 2 keywords in the same sentence:
This {{is}} just an ...
$id=mysql_real_escape_string($levelid);
$l=mysql_real_escape_string($level);
$levDes=mysql_real_escape_string($leveldescription );
$sql="UPDATE `levels` SET level='$l',leveldescription='$levDes' WHERE id='$id' LIMIT 1";
$result=mysql_query($sql);
if(!$result){throw new Exception(mysql_error());}
$effectedRow...
So let's say that I have:
<any_html_element>maybe some whitespaces <br/>Some text</any_html_element>
And I want to remove the first <br/> after <any_html_element>.
How can I do that?
Best Regards
...
I have a small PHP framework that basically just loads a controller and a view.
An empty page loads in about 0.004 seconds, using microtime() at the beginning and end of execution.
Here's the "problem". If I do the following:
$link = @mysql_connect($server,$user,$pass,$link);
@mysql_select_db($database, $link);
the page loads in about...