php-general Digest 9 Dec 2007 10:26:42 -0000 Issue 5171
php-general Digest 9 Dec 2007 10:26:42 - Issue 5171 Topics (messages 265583 through 265589): Re: build a multi chat server with php 265583 by: Robert Cummings 265584 by: Robert Cummings 265585 by: Nathan Rixham 265586 by: Børge Holen 265589 by: abderrazzak nejeoui Incorporating a PHP/MySQL based search 265587 by: Steve Finkelstein 265588 by: Cesar D. Rodas Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Sat, 2007-12-08 at 16:46 +, Nathan Rixham wrote: 1 - yes you can make a multichat daemon in php 2 - if you don't know that it's possible or where to begin, then odds are you won't be able to make it. That's what the list is for... to help him find his way. abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks There are two approaches. You either are looking to do it as a standalone application outside of the web environment, or you are looking to do it via the web environment using some combination of backend PHP and front end browser refreshes (not recommended) or AJAX. A simple scenario for the web version follows: 1. User logs in (or implicitly is logged in anonymously) 2. User sees any ongoing discussion for X amount of previous time 3. User can post a form to the website (or post data via AJAX) which effectively is the user's message to the chat server 4. Message is save to database with ID/timestamp 5. Browser refreshes or AJAX retrieves messages greater than user's session message ID 6. Return to step 1. The session is responsible for tracking the last message ID retrieved by the user. This could also be facilitated by the browser, but it will almost certainly be problematic. Additionally, but having it in the session you ensure the user can't arbitrarily jump back in time (this may be a privacy issue if chat users only expect those logged in to ever see their messages). Additionally when saving messages or viewing messages you may want to track a group ID that refers to the chat forum in which the messages are being posted/retrieved. In this way you can have multiple chat rooms. This should get you started or asking questions more to the point. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... ---End Message--- ---BeginMessage--- On Sat, 2007-12-08 at 12:19 -0500, Robert Cummings wrote: On Sat, 2007-12-08 at 16:46 +, Nathan Rixham wrote: 1 - yes you can make a multichat daemon in php 2 - if you don't know that it's possible or where to begin, then odds are you won't be able to make it. That's what the list is for... to help him find his way. abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks There are two approaches. You either are looking to do it as a standalone application outside of the web environment, or you are looking to do it via the web environment using some combination of backend PHP and front end browser refreshes (not recommended) or AJAX. A simple scenario for the web version follows: 1. User logs in (or implicitly is logged in anonymously) 2. User sees any ongoing discussion for X amount of previous time 3. User can post a form to the website (or post data via AJAX) which effectively is the user's message to the chat server 4. Message is save to database with ID/timestamp 5. Browser refreshes or AJAX retrieves messages greater than user's session message ID 6. Return to step 1. Should have been: 6. Return to step 3. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... ---End Message--- ---BeginMessage--- Robert, Abderrazzak, You make some good points, and apologies abderrazzak; I woke under stress and haven't been the friendliest today! The Ajax method is definately a good approach, particulary if you're wanting to have the chat client within a web page. The other approach is to make a php chat daemon, this can be achieved by running php through the CLI. To get started some reading of the PHP Manual would be advised, partculary under stream_socket_server, stream_socket_accept, pcntl_fork, the CLI section itself, and finally some catching up on php wrapeprs to stdin, stdout
php-general Digest 9 Dec 2007 22:47:02 -0000 Issue 5172
php-general Digest 9 Dec 2007 22:47:02 - Issue 5172 Topics (messages 265590 through 265592): Re: build a multi chat server with php 265590 by: Børge Holen 265591 by: Nathan Rixham 265592 by: Jochem Maas Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Sunday 09 December 2007 11:17:36 you wrote: thank you Børge Holen, I think the third solution is very COOL , using the jabber 2.0 in the backend but i'm still confusing how can i get communicate the jabber srver with web chat page! if u can explain more i will be gratful. http://www.jabber.com/CE/JabberXCP have a look. me and a pal had this thing communicating in/out of Second Life / webinterface... nothing usable, we just made it work and was thinking of using it for a mobile - second life thing end of story for some reason, things to do and bills to pay. Best regards 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 16:28:06 you wrote: live chat throught a web page like www.amitie.fr then I got three solutions for you, either make a (as mentioned by others on the list) an ajax frontend witch do the irc lookalike. You can create a webinterface for an irc server. I think java is often used for this solution, you can probably also use ajax. (this isn't as hard as is looks, I think this solution is easier than the first one) And as a third and ... the COOL solution is to user the jabber 2.0 as the backend and some php stuff in the middle and a nice interface, that you can connect directly using a jabber client (maby throught a mobile) and someone on the same time using the webpage to chat with you ?;D This option is of course available on the second option to, except you use irc. All this open protocolls just makes us nerds go crazy!!! 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 09:59:35 abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks chat as in : forum livchat throught a page livechat throught an external program, -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- --- Børge Holen http://www.arivene.net ---End Message--- ---BeginMessage--- Anybody up for (or indeed see a need for) a multi threaded php daemonised jabber client? Looks like an interesting challenge! Børge Holen wrote: On Sunday 09 December 2007 11:17:36 you wrote: thank you Børge Holen, I think the third solution is very COOL , using the jabber 2.0 in the backend but i'm still confusing how can i get communicate the jabber srver with web chat page! if u can explain more i will be gratful. http://www.jabber.com/CE/JabberXCP have a look. me and a pal had this thing communicating in/out of Second Life / webinterface... nothing usable, we just made it work and was thinking of using it for a mobile - second life thing end of story for some reason, things to do and bills to pay. Best regards 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 16:28:06 you wrote: live chat throught a web page like www.amitie.fr then I got three solutions for you, either make a (as mentioned by others on the list) an ajax frontend witch do the irc lookalike. You can create a webinterface for an irc server. I think java is often used for this solution, you can probably also use ajax. (this isn't as hard as is looks, I think this solution is easier than the first one) And as a third and ... the COOL solution is to user the jabber 2.0 as the backend and some php stuff in the middle and a nice interface, that you can connect directly using a jabber client (maby throught a mobile) and someone on the same time using the webpage to chat with you ?;D This option is of course available on the second option to, except you use irc. All this open protocolls just makes us nerds go crazy!!! 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 09:59:35 abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks chat as in : forum livchat throught a page livechat throught an external program, -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net ---End Message--- ---BeginMessage--- Nathan Rixham wrote: Anybody up
Re: [PHP] build a multi chat server with php
thanks for Nathan, Robert Cummings and Børge Holen, the information you sent are very useful Cordially Nejeoui 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 16:28:06 you wrote: live chat throught a web page like www.amitie.fr then I got three solutions for you, either make a (as mentioned by others on the list) an ajax frontend witch do the irc lookalike. You can create a webinterface for an irc server. I think java is often used for this solution, you can probably also use ajax. (this isn't as hard as is looks, I think this solution is easier than the first one) And as a third and ... the COOL solution is to user the jabber 2.0 as the backend and some php stuff in the middle and a nice interface, that you can connect directly using a jabber client (maby throught a mobile) and someone on the same time using the webpage to chat with you ?;D This option is of course available on the second option to, except you use irc. All this open protocolls just makes us nerds go crazy!!! 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 09:59:35 abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks chat as in : forum livchat throught a page livechat throught an external program, -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net
Re: [PHP] build a multi chat server with php
On Sunday 09 December 2007 11:17:36 you wrote: thank you Børge Holen, I think the third solution is very COOL , using the jabber 2.0 in the backend but i'm still confusing how can i get communicate the jabber srver with web chat page! if u can explain more i will be gratful. http://www.jabber.com/CE/JabberXCP have a look. me and a pal had this thing communicating in/out of Second Life / webinterface... nothing usable, we just made it work and was thinking of using it for a mobile - second life thing end of story for some reason, things to do and bills to pay. Best regards 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 16:28:06 you wrote: live chat throught a web page like www.amitie.fr then I got three solutions for you, either make a (as mentioned by others on the list) an ajax frontend witch do the irc lookalike. You can create a webinterface for an irc server. I think java is often used for this solution, you can probably also use ajax. (this isn't as hard as is looks, I think this solution is easier than the first one) And as a third and ... the COOL solution is to user the jabber 2.0 as the backend and some php stuff in the middle and a nice interface, that you can connect directly using a jabber client (maby throught a mobile) and someone on the same time using the webpage to chat with you ?;D This option is of course available on the second option to, except you use irc. All this open protocolls just makes us nerds go crazy!!! 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 09:59:35 abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks chat as in : forum livchat throught a page livechat throught an external program, -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] build a multi chat server with php
Anybody up for (or indeed see a need for) a multi threaded php daemonised jabber client? Looks like an interesting challenge! Børge Holen wrote: On Sunday 09 December 2007 11:17:36 you wrote: thank you Børge Holen, I think the third solution is very COOL , using the jabber 2.0 in the backend but i'm still confusing how can i get communicate the jabber srver with web chat page! if u can explain more i will be gratful. http://www.jabber.com/CE/JabberXCP have a look. me and a pal had this thing communicating in/out of Second Life / webinterface... nothing usable, we just made it work and was thinking of using it for a mobile - second life thing end of story for some reason, things to do and bills to pay. Best regards 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 16:28:06 you wrote: live chat throught a web page like www.amitie.fr then I got three solutions for you, either make a (as mentioned by others on the list) an ajax frontend witch do the irc lookalike. You can create a webinterface for an irc server. I think java is often used for this solution, you can probably also use ajax. (this isn't as hard as is looks, I think this solution is easier than the first one) And as a third and ... the COOL solution is to user the jabber 2.0 as the backend and some php stuff in the middle and a nice interface, that you can connect directly using a jabber client (maby throught a mobile) and someone on the same time using the webpage to chat with you ?;D This option is of course available on the second option to, except you use irc. All this open protocolls just makes us nerds go crazy!!! 2007/12/8, Børge Holen [EMAIL PROTECTED]: On Saturday 08 December 2007 09:59:35 abderrazzak nejeoui wrote: Hello, i want build a multi chat server based in php. 1- is that possible 2- if yes can you instruct me how to bigin thanks chat as in : forum livchat throught a page livechat throught an external program, -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] build a multi chat server with php
Nathan Rixham wrote: Anybody up for (or indeed see a need for) a multi threaded php daemonised jabber client? Looks like an interesting challenge! u know the old saying, if you build it they will come ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] build a multi chat server with php
On Sunday 09 December 2007 23:46:44 Jochem Maas wrote: Nathan Rixham wrote: Anybody up for (or indeed see a need for) a multi threaded php daemonised jabber client? Looks like an interesting challenge! u know the old saying, if you build it they will come ;-) lol, for true... -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] proc_open fclose streams..
Nathan Rixham wrote: Hi Guys, Hoping somebody out there may have come across this one, possible functionality request depending on responses. $descriptor = array( 0 = array(pipe, r), 1 = array(pipe, w), 2 = array(pipe, w) ); $process = proc_open('mysql', $descriptor, $pipes); fwrite($pipes[0], 'show databases;'); echo stream_get_contents($pipes[1]); //won't work, crash, time out.. nothing returns as we need to.. fwrite($pipes[0], 'show databases;'); fclose($pipes[0]); // note the fclose echo stream_get_contents($pipes[1]); I don't want to fclose pipes[0] though, as i want to keep it open and keep writing to it, alternating with reading from pipes[1] and [2].. so a replacement for fclose, or an fflush on stdout that works? The problem appears to be that nothing is returned to php until the stdin pipe is closed, even if I write hundreds of commands to it. I think that's controlled by the process you're calling rather than a php thing. For example, smtp connections do this until you enter a '.' on a single line. ie the process you're calling doesn't know when to stop reading from stdin until you close the conn. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shipping Address on Paypal
Hello Friends, As i am integrating Paypal pro (For CC) in my site. Our client has a merchant account. We have a kit for paypal integration with client 'credential certificate'. We are getting success and payment is completed. We have a problem that shipping address is not displayed on paypal site in merchant account in order detail page. Ship to: tab is blank. We tried a lot to send the shipping address from our site but could not succeed. So please help us to send the shipping address to the paypal so our merchant can see the shipping address in order detail page with other details. If any code please post it will be help to us and also to the others. Thansk, Javed -- View this message in context: http://www.nabble.com/Shipping-Address-on-Paypal-tp14247826p14247826.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shipping Address on Paypal
Javed Chauhan wrote: Hello Friends, As i am integrating Paypal pro (For CC) in my site. Our client has a merchant account. We have a kit for paypal integration with client 'credential certificate'. We are getting success and payment is completed. We have a problem that shipping address is not displayed on paypal site in merchant account in order detail page. Ship to: tab is blank. We tried a lot to send the shipping address from our site but could not succeed. So please help us to send the shipping address to the paypal so our merchant can see the shipping address in order detail page with other details. If any code please post it will be help to us and also to the others. https://www.paypal.com/IntegrationCenter/ic_home.html Ask paypal how to do it. They have api's and even an area for support tickets. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php