php

Sometimes redirecting failed mysteriously in PHP?

@header('Location: ' . $uri); But it only seldom happens,what's the problem? ...

JQuery autocomplete result

Hello I am using autocomplete to allow users to search venues stored in a MySQL database. The autocomplete plugin is currently listing the venues when the user begins typing and prints the selected venue using the result handler. I would like to also print the address, phone number and website of the venue as well but I am not sure how ...

Chat application through php

I want to build a chat application using PHP. Does anybody have any idea about it? If so please reply. The chat application must be user friendly, multiple chatting scenario must be there. ...

Feedback that a slow php script is working?

Running a PHP script that is doing a huge mysql query plus some crunching on the results. Because of this the script takes a long time to execute and may appear to be not working to the user. Is there a way to provide feedback to the user that the script is running? Perhaps way to print to the browser with each loop - indicating what r...

Handling user login tokens

So I want users to be able to login from different computers simultaneously. So that means I should allow the user to have multiple tokens. And then I also want the user to be able to login from different browsers on the same computer. So that means I should allow the user to have multiple tokens for same IP. However, it's gonna get m...

Reverse Geocoding With Google Map API And PHP To Get Nearest Location Using Lat,Long coordinates

I need a function to get an nearest address or city from coordinates(lat,long) using google map api reverse geocoding and php... Please give some sample code ...

PHP: high depth array, how do return current key name?

I have a huge array from a json_decode result (assoc set to true) and have the following code to check if (one of the arrays within, a random serial) has the key 'set_true' $out = ""; foreach ($array as $sub) { //$out[] = $sub['set_true']; if (in_array($sub['set_true'], $sub) && $sub['set_true'] == '1' ) { $out[] = 'User: ' . $...

PHP: get current array key?

$array = ( array('1231415'=>array('foo'=>'bar', 'test'=> 1)), array('32434'=>array('foo'=>'bar', 'test'=> '0')), array('123244'=>array('foo'=>'bar', 'test'=> 0)), array('193928'=>array('foo'=>'bar', 'test'=> 1)) ); I have an array that has (many) random keys, the ID number. I need to test each array within if 'test' = ...

comet with php socket server?

i've read that php doesn´t scale well if a lot of users are using your comet implementation? is that because of the apache server or the php language? what is a socket server and does it fix that problem? someone that has set up a php comet server for a lot of users that could give some advice? ...

Intensive PHP script failing w/ "The timeout specified has expired" error / ap_content_length_filter

Running a mysql intensive php script that is failing. Apache log reports this: [Wed Jan 13 00:20:10 2010] [error] [client xxx.xx.xxx.xxxx] (70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed, referer: http://domain.com/script.php Tried putting set_time_limit(0) at the top. Also tried set_time_...

Using static properties in PHP >= 4.3.0?

Disclaimer: Yes, I am forced to support PHP 4.3.0. I know it's dead. No I can't upgrade it, because I'm dealing with multiple servers some of which I don't have su access. Well, since I can't use self:: since it's PHP5 specific, how should I go about implementing statics in a PHP4 class? So far from my research it seems that I can...

Is mb_strlen a suitable replacement for iconv_strlen

That is, if I'm coding something entirely in PHP4? Or perhaps I should use a custom function or class/extension instead to count the number of characters in a multibyte string? Only difference I can spot is that mb_string strips out bad sequences, while iconv_strlen doesn't. ...

php chat client

i need to create a chat application in php+js+ajax which need to be integrated to a site, where am stuck is to create a chat window , that need to be constant while going through different pages in the site . if any one can suggest a better way i will be grateful, thanks in advance ...

How to intergrate paypal into an application?

Im planning to allow people to create premium accounts on a site. There is a simple registration form, at the end of which I want to direct people to paypal where they will make a payment, and then be sent back to my site with their newly created account now activated (if transaction went thru). I dont want a fully hosted solution ("We...

translate one language to another?

is it possible to translate one language to another with an interpreter? heard that quercus could translate php to java? at first, i thought it was a cheap lousy solution which could give code errors, but it seems that it´s fully possible to do so. could you translate php to other languages, like python or ruby? c++ to java and so on? ...

Rss feed writer for php mysql

hi i have the around 15 articles in my table, i want rss feed writter script, Refer some open source site for this.. ...

How to create MySQL back up executable file?

I am using php, mysql and my server is Windows Server 2003 with IIS6. I am planning to backup my database on hourly basis. I can do the cronjob, tested by write date&time into a log file. It works perfectly. Now I want to use the cronjob to backup my databases. How do I do that? Create a php script and let it run every hour?? ...

PHP Library That Generates ASCII Art Text

I'm trying to make a captcha system that isn't the same as all the others using ASCII art text. Similar to what can be found here. Does anyone know of a library which can generate something similar? ...

PHP typecasting float->int

Given this PHP code: // total is 71.24 (float) $value = $total * 100; var_dump($value); $valuecast = (int)$value; var_dump($valuecast); settype($value, 'int'); var_dump($value); var_dump($value) gives float(7124) var_dump($valuecast) gives int(7123) var_dump($value) after settype gives int(7123) How can I get the correct type conve...

php form errors

hello im trying to set custom errors. i got a form. actions to post.php i dont want form to go post.php for errors i need to set errors in same page. i tried $sql = " INSERT INTO yazilar (baslik, spot, spot_kisa, spot_resim, spot_resim_isim, icerik, kategori, tiklanma, eklemetarihi) VALUES ('$_POST[baslik]','$_POST[spot]','...