Real-time Chat
I wrote a PHP chat system similar to gChat which simply uses constant ajax calls to update the chat. This system is fine for a few users, but with potentially thousands of users, it is much too hard on the server. I've been considering taking the 'Comet' route, but have heard that PHP can't handle Comet very well. What would be the best language/API to perform real-time chat for a large user-base?
View Complete Forum Thread with Replies
Related Forum Messages:
Real Time Chat
There's anyone out there that can give me a light on real time chat using sockets. I've seen some using push technics but they all hang up after an elapsed amount of time.
View Replies !
Real-time Output?
I'm a relative PHP newbie, so I apologize if this is a simple question. Anyway, here's my problem. I'm using a PHP script to pre-render a bunchload of insert files for an HTML page. Right now there's about 1,600, but that number could get much, much higher when the site goes live. I'll only need to re-render the whole batch once or twice a year (if that) but it's still something I'd like to be able to do in case I have to move the site to a different server, or there's a hard drive crash or etc. Basically what the script does is grab a whole bunch of information from a database and write the insert file. It does this for every single one. The problem of course, is that PHP by default does all this server-side, and then sends it to the browser. Because this process takes like ten or twenty minutes to do, the browser times out long before it's finished. Is there a way to get progressive output with PHP? Or do I need to re-do this in another language like Perl?
View Replies !
Real-time Clock
Where should I start to write a Real-time Clock? I want it be dynamic, not static. I know how to get the time and display it but how do I keep changing it ?
View Replies !
Real Time Sql Query
I am making a web-based chat but to get the msg from the database i need to refresh the page and that will make load and extra bandwidth on the server so i want to make the query in real time ( only the new msg to be received without refresh the whole page ), Any one in here knows how to get data from sql database without having to refresh page.
View Replies !
Real Time Echo'ing Of Var In A Loop
i have a big loop, and rather then waiting until its done for me too see what happened, every time it runs, how can i get the browser to echo the result, and proceed to keep running the loop. basically this loop takes a long time to finish, and i had to set my max runtime past 30 seconds. i guess incorporating a refresh of some sort like this would eliminate the need for the time extension too?
View Replies !
Real Time Form Update
i have a script that i wrote for my clan/guild/linkshell in this online game i play that keeps track of members, the points they receive from events, items etc. in the admin panel of the script where you can update peoples points i want to know if i can add a button or something similar that if you push it updates the points which is currently in another text box in the same form in real time. I'm sorry if i'm not being clear, what i'm trying to do it make it quicker to update a members points because usually after each event they receive either 10 or 20 so i want to add a button where if you push it then it will put 10 or 20 in the 'add' box in real time. right now when you edit a member it shows their current points in a text box and under that two text boxes, one if you want to add points and another if you want to subtract points. if this isnt possible then i assume that i'd have to make it update the points in the box and keep all the values from before and just reload the page with the new value inside the box. wow, i'm sorry if i'm not very clear, please ask questions if you dont understand what i'm trying to say.
View Replies !
Real-time Action Ala Games??
What would be a proper solution for automated decision making in a PHP script, like a game? That is, without an external application, or any human input. For example, any random event that happens when the player is away from the game. How would one go about implementing that?
View Replies !
Real Time Listbox Update
I have one listbox that I populate with while($row = mysql_fetch_array($result, MYSQL_ASSOC) I need to in real time populate another listbox from a related table based on what they have currently selected in the first listbox. Is this possible with php and if so.
View Replies !
Read Data From MS Access Into MySQL In Real-time
I am currently working on a project that involves reading information from a inventory system into Access via ODBC and display the info on the web site using MySQL. I would like to create a live link between the MS Access(local) and MySQL (remote) whenever the inventory system is updated MySQL will be updated as well. I know that MyODBC will let me do the opposite of what I would like to accomplish by reading data in MySQL into Access. Is it possible to do the reverse way.
View Replies !
How Can One Get Real Time Stock Quotes For An Online-community?
For one of our web-communities we plan an offer of real time stock quotes incl. advanced notification services. I have the following questions: - Do you know of any services, that already offers such services in a decent way? And more important: - Does anybody know a provider of such services, that offers a real-time stock quote data stream for such a usage at a decent price? I only know of Deutsche Börse offering it for 1駨 Euro per month. That is too expensive for us.
View Replies !
Chat Function That Allows Users To Seek Help Via Live Chat
I found that some of these pre-made help desks also have a live chat function that allows users to seek help via live chat, similar to aim. (Once you log into the help desk at php live, click on the "launch request monitor window" to get a better understanding of what I am talking about.) Unfortunately, I showed this to my boss and he liked that idea. Why unfortunate? I have no idea where to start on this one! I have done several web apps with php and mysql, so I would say I have a fair grasp and understanding, but this one has me stumped. Has anyone done something similar to this or have an idea in which direction that I need to be going?
View Replies !
A Real Challenge For Real PHP Programmers
<?php /* A challenge to every PHP programmer.The one who's gonna solve this problem would be deemed as PSP(PHP Supreme Programmer).The problem is this : You have to write a script that displays a list of categories and subcategorieslike this one: <select name="category"> <option value="1">Main</option> <option value="2">Main > Computers</option> <option value="4">Main > Computers > Hardware </option> <option value="8">Main > Computers > Hardware > PC</option> <option value="7">Main > Computers > Hardware > Mac</option> <option value="9">Main > Computers > Hardware > Atari</option> <option value="11">Main > Computers > Hardware > PC > History of Pc</option> <option value="">etc...</option> </select> The categories and subcategories details are stored in these two tables in a MySQL database. -categories : the categories names and ids. -cat_relations : the relations between categories.It shows which subcategory belongs to which category. The belongings between categories can go very deep and the number of categories is unlimited. This script will create the two tables and fill them with sample data. All you need to do is to change the four variables below. You can send the script back to this email : yasbergy@yahoo.com. */ //Here starts the script. Please change the values of these variables to fit your settings $user = "prospective_PSP"; $database = "db"; $server = "localhost" ; $pwd = "" ; //Connection to the database that you created mysql_connect($server,$user,$pwd) ; mysql_select_db($database); //Creation of the two tables : categories and cat_relations $categories = " CREATE TABLE `categories` (`id` INT not null AUTO_INCREMENT, `name` VARCHAR(100) not null , PRIMARY KEY (`id`), INDEX (`id`), UNIQUE (`id`)) comment = 'The categories details' "; mysql_query($categories) ; $cat_relations = "CREATE TABLE `cat_relations` (`id` INT not null AUTO_INCREMENT, `daughter_id` INT not null, `mother_id` INT not null , PRIMARY KEY (`id`), INDEX (`id`), UNIQUE (`id`)) comment = 'Which category is the daughter of which category'"; mysql_query($cat_relations) ; //Filling the two tables with sample data $cats = array('Main','Computers','Countries','Hardware','S oftware','Programming languages','Mac','PC','Atari','Winamp','History of the PC','IBM','Components','High level','USA','NYC','LA','Manhattan','India','Winzi p'); for ($i=0;$i<count($cats);$i++){ $sql = mysql_query("insert into categories (name) values('".$cats[$i]."')"); } mysql_query("insert into cat_relations (daughter_id,mother_id) values (2,1),(3,1),(4,2),(5,2),(6,2),(7,4),(8,4),(9,4),(1 1,8),(12,8),(13,8),(10,5),(20,5),(14,6),(15,3),(16 ,15),(17,15),(18,16),(19,3)"); //Now you can have a look on them through phpMyAdmin ?>
View Replies !
Db Update And Real Time Update
i wanted to put together my first pages using prototype but i'm kinda stuck. situation: i got a list of pages in the backoffice. in the list you got pagenames, id's, editors and if they're active or not. the active part part is represented by an in/active image. now instead of having to edit the page and change a checkbox to toggle the active status of the page, i was planning to make it able to click on the image in the list itself to toggle the status of the page. thus updating the db when you clicked and refresh the list using ajax. Code:
View Replies !
Getting The REAL Directory?
Is there any way to get the directory/path of the file running the script, not the directory you're inside (Via dir())? I'm allowing the user to navigate through directories, and that part works great - but whenever I attempt to used getcwd(), it returns the directory the user is in - not the directory of the php file - is there any way to get the directory of the .php file the user is using?
View Replies !
Real Estate MLS/IDX
I am trying to program an MLS/IDX search feature to be integrated into a real estate website. This progrom will allow MLS/IDX searching/browsing (searching by MLS #, house variables, etc) and browsing by property location, etc. I have come accross RETS and have tried to go about it, but wow, maybe MLS/IDX is just some mythical database that doesn't exist? If anyone can help me out here. show some code, point me to a resource, tutorial, something that would be some assistance, I would bow down to them, and mail them one, yes, one ice cold root beer.
View Replies !
Resolve Real IP
I can get the apparent IP from $_SERVER['REMOTE_ADDR']; . However, how can I find the real IP if the user is behind a proxy? I know it must be possible as some "whatismyip" sites do it.
View Replies !
Mysql Real
I found this which I think calls for an indepth brain storming. A very good reading [edited by: eelixduppy at 1:06 pm (utc) on Sep. 12, 2007] [edit reason] fixed typo as per request [/edit]
View Replies !
Real Length Of Arrays
Sometimes, I want to know how many elements are really in an array (php3). The count() and sizeof() functions apparently return the number of non-empty array elements, and if you do a while loop checking for empty will stop on the first empty element. I have been using the following function: function truecount($theArray) { if (is_array($theArray)) { end($theArray); return key($theArray); } } but if the key is non-numeric, won't that trip me up? Anyone have a better solution?
View Replies !
Md5 / Sha1 - Any Real Difference?
I use md5 hash with some of my cookies and occassionally a hidden form field - I know the physical data on my network is insecure (unless being served via https) but I was wondering if there are any advantages to using md5 over sha1 or versa vicea... I know md5 gives me a unique 32bit hash while sha1 I've read is 'secure' (?) and gives a 40bit hash... Since The technical webpage on sha1 is lengthy and for the most part over my head... and other than today, I've never heard of it before... I was wondering if anyone could offer any comments on it...
View Replies !
Htmlspecialchars/real Escape
I'm creating a BBCode parser, and everything's working but one thing; I need code tags, but I will need to real_escape/htmlspecialchars the post to make sure it isn't malicious. The only problem is if I real_escape with code tags that contain php, the php will be removed. If I specialchars the post with php, I can't have syntax highlighting (or, not easily). How do I get round this?
View Replies !
Real IP Address From Behind Proxy Or NAT
How to get the real IP address of a user, not that of their proxy server or the external NAT address. I was quite sure that this wasn't possible without some kind of process getting the address on the client machine. I have suggested that these sites could be using Java to get the real IP address, however, I could be wrong and for me the script that I found always returns 127.0.0.1 . This suggests to me that any script attempting to obtain the hosts real IP address infarct rely s on the HTTP-X-FORWARDED-FOR header sent by the proxy server...
View Replies !
My Real Estate Scripts
I have been writing a real estate agency program and its coming on well but taking longer than I thought. Also I think I am just re-inventing the wheel as I guess like BB scripts there are probably good free ones already writen in php and using mysql ? Can anyone recommend one.? can then continue learning while adapting it to my purposes.
View Replies !
REAL E-mail Validation
if there is a way to actually send an e-mail to the server and see if it bounces or not? What I'm trying to do is require users to enter a valid e-mail address on the front page before entering the site. I don't want to do simple character validation (check for @ and no special chars, etc, etc) but actually see if the e-mail account truly exists before letting them into the site.
View Replies !
Mysql Real Escape
Upon entry into the database, I first clean form input data with html special characters, strip tags, and mysql real escape string. When I retrieve this data from the db, single quotes aren't coming out right on the pages. Some browsers display a question mark, others a blank space, and another (FireFox) totally screws up the text formatting.
View Replies !
Real Escape String
How can i add a escape string to this php mysql query. mysql_query('insert into times (code, date, time, duration) values ("'.$course_code.'","'.$date_inSQL.'","'.$time_inSQL.'","'.$duration.'" )');
View Replies !
Web Chat?
I want to create chat window for my web site.How can i solve this, a java based code should also be ok!
View Replies !
Php Chat
i have made a chat script that uses META REFRESHES to update from a flat txt file. this is very inefficient for both server and user. the problem is i can't think of any other way to do it. one way i can think of is to open sockets so that a server can look at the file and see if it has been changed. of course, i have no idea where to start, so instead i built a really bad script that was worse on the client (i.e. 100% CPU usage) but not so bad on the server. any ideas? PHP Code:
View Replies !
Chat
I'm about to write a small chat application. To keep the flow of new messages coming, two things are possible. The first is to use a hidden frame, and to reload it every couple of seconds. The second would be to keep open the connection in the hidden frame (so the page is never realy loaded). I would prever the latter, but don't know how one keeps open the connection. What happens if the user closes the browser?
View Replies !
Real Audio Download Limiter
i'm running a site with .ra and .ram files, when some visitor download or stream all these files at the same time it causes an huge bandwidth consumption. so i'd like to limit the download per each IP to a certain number of .ra and .ram files at time. i wonder if i can use some php script with cookies session but i'm new to this and i don't know where to start.
View Replies !
PHP Template Redirecting To Real Video
I've developed a RealVideo content management system w/ PHP and MySQL. On the back end is a form that sends a Real Video file (.rm) and writes the filename to a database. On the front end is a PHP template that pulls the filename from the database and outputs a string that is read in by a Flash movie. The Flash movie reads in the file location and places HTML-encoded text inside a text field that says "Launch Video." All works fine -- the Flash movie launches the Real Video file, and the file plays correctly. There's only one problem: the Real Video doesn't stream. In order for a Real Server to stream a Real Video file, a "stub" file with the extension .ram needs to be placed in the root directory. The only content in these .ram files is a URL pointing to the actual .rm file, and it's written in this format: pnm://ra.domainName.com/realvideoFile.rm My problem: The form is sending a Real Video file and the receiving page is copying it to the server as well as inserting a record into my database, but it can't write a .ram file to the root directory because to do so I'd have to adjust permissions accordingly (PHP is part of group Apache). That's unacceptable; I won't adjust permissions on the root directory. My solution was to create a redirector that acts as the stub file: PHP Code:
View Replies !
Is Gmail Homepage Real Ajax?
I saw gmail's storage size on mail.google.com. It was counting size like "Over 2728.845439 megabytes". then increasing... but my dialup connection disconnected I don't understand howto count storage size, when my pc disconnected internet. is it real 2728.845439 MB? or only text?
View Replies !
Stripping Commas From Real Numbers
I have an HTML form in a PHP script which queries the user for a dollar amount of sales. If a user enters "1,000,000" rather than "1000000" for 1 million, PHP (or MySQL?) treats the commas as a decimal and "1" is entered in the database. A simple work-around is to simply advise the user "Please enter numbers only, no commas or $'s" but this seems awkward. Is there a built in function or another easy way to have commas and currency signs stripped out of form-entered data?
View Replies !
Exploding At Real Breaks Not Wraps
I am working on reading my pop3 email , and I am trying to return the header data using the function, I get this fine. The question I have is since there is no consistency to the rows, I want to take each row of data, not a wrap of a long line, any idea beyond checking if it has a : in it???
View Replies !
Creating A Real Estate Site
I am intereted in creating a real estate where I can place house for people to view. I would like to have each room viewable, customer login area, quote for house, 360 degree view of the room, slick looking site. Is there a script that will enable me to do such a thing, or do I need it created from scratch?
View Replies !
Degugger On 5.2.2 (xampp 1.6.2) Real Brainer
I tried to get php dbg debugger working on my machine but it doesn't work at all. Ok, what i did: copied php_dbg-5.2.x.dll (for PHP 5.2.x version) into my xampp/php/ext directory next, modified /xampp/apache/bin/php.ini file appending: Code:
View Replies !
API For Yahoo Chat?
How to get the contact list of a particular user from Yahoo chat from an external application? Is there any API available for this purpose?
View Replies !
Realtime Chat
i want to code a realtime chat. the server side is done (php), what i need now is the best way to refresh the page/frame containing the messages periodically (t < 500 ms). i think i could do this with a little bit of javascript. does anybody have some good code (normal mouse cursor in browser etc), or is there a better way?
View Replies !
PHP Stream (chat)
how the PHP stream chats works? There is lot of "normal" chat where the page will be updated regurarly but I am looking for php based chat where there is no update every 5 seconds...
View Replies !
Chat With You Friends
<?php // Get the names and values for vars sent by index.lib.php3 if (isset($HTTP_GET_VARS)) { while(list($name,$value) = each($HTTP_GET_VARS)) { $$name = $value; }; }; // Get the names and values for post vars if (isset($HTTP_POST_VARS)) { while(list($name,$value) = each($HTTP_POST_VARS)) { $$name = $value; }; }; // Fix some security issues if ((empty($From) || trim($From) == '') || (empty($U) || trim($U) == '') || (empty($R) || trim($R) == '') || (empty($Ver) || empty($L) || empty($N)) || (!isset($T) || !isset($D) || !isset($O) || !isset($ST) || !isset($NT)) || !is_dir('./localization/'.$L)) { exit(); } require("./config/config.lib.php3"); require("./localization/".$L."/localized.chat.php3"); require("./lib/release.lib.php3"); require("./lib/database/".C_DB_TYPE.".lib.php3"); require("./lib/clean.lib.php3"); header("Content-Type: text/html; charset=${Charset}"); // avoid server configuration for magic quotes set_magic_quotes_runtime(0); $U = urldecode($U); $R = urldecode($R); // Translate to html special characters, and entities if message was sent with a latin 1 charset $Latin1 = ($Charset == "iso-8859-1"); function special_char($str,$lang) { return addslashes($lang ? htmlentities(stripslashes($str)) : htmlspecialchars(stripslashes($str))); }; $DbLink = new DB; // ** Updates user info in connected users tables and fix some security issues ** $DbLink->query("SELECT room, status, ip FROM ".C_USR_TBL." WHERE username = '$U' LIMIT 1"); if ($DbLink->num_rows() != 0) { list($room, $status, $knownIp) = $DbLink->next_record(); $DbLink->clean_results(); $kicked = 0; // Security issue include("./lib/get_IP.lib.php3"); if ($knownIp != $IP) { $kicked = 5; }
View Replies !
Chat Scrolling
I have need to know how when a person posts a message to a chat room window how to get the chat room window (iframe) to scroll when that message is posted instead of the person having to scroll the window themselves to see the newly posted messages. Any ideas?
View Replies !
A Chat Script
I've made an attempt at a chat script, but it isn't performing exactly how I want. Yes, I am a relative newbie to PHP. I've spent hours on Hot Scripts looking for something, but nothing I found meets what I need. Code:
View Replies !
|