php

How to paginate a list of images in PHP

I have a list of images which I want to display in a page. I want to paginate the list of images, so I can have 10 images per page. can you help me to do that? ...

How can I benchmark/profile my PHP/MYSQL news site in order such I can compare it later on with a django/postgres recoded version?

I'm looking for some type of profiling utility I could use where I can compare between 2 different setups with some sort of consistency factor. Would appreciate if anyone could point me in the right direction. ...

check this script and answer, facebook?

http://wiki.developers.facebook.com/index.php?title=Fb:js-string&amp;redirect=no in the above link, example coding provided "Real example (PHP): " passing variable to how to work with? convert to code how to use in <'?php XXXXXXXXXXXXXXXXX ?> tag? ...

What is the first language to have inline commands in HTML code?

I'm learning PHP. The PHP has inline commands in HTML code to produce dynamic HTML output. <div> <?php echo 'hello world'; ?> </div> In Java and .NET world, there are similar syntax to have commands in HTML. I'm wondering what is the first language or platform have this kind of syntax. Having dynamic code embedded in HTML code an...

Why is this warning being shown: "Received problem 2 in the chunky parser"?

Hi, I am trying to use PHP and cURL to log in to a website (namely Craigslist). When accessing the script, I get this warning message: Received problem 2 in the chunky parser Searches showed that it is not a problem associated with cURL. I am unable to find the source of the problem. What may be the reason? Thank you. ...

Dynamic resizing images cache

I use simple PHP code (zend framework) to resize jpg images on the fly. Problem is I always end up with HTTP 200 status, instead having 304 and allow browsers to cache images. I cant get apache headers, function_exists('apache_request_headers') is false, and in server variable I have only 'HTTP_ACCEPT' => 'image/png,image/*;q=0.8,*/*...

Special PHP Errors

How can PHP cause memory leaks, buffer overflows, stack overflows and any other errors of such kind? Can PHP even cause such errors? ...

Use Google Maps to search on a user defined map.

Hey Guys, I am creating an application to search for all drama theaters in my state. I collected the geo coordinates for the same and also created the KML which was then uploaded to my maps and I now have the respective map id. Application is being created using PHP / Zend and I would like to invoke the Search API using a server-serve...

PHP Xpath : get all href values that contain needle

Working with PHP Xpath trying to quickly pull certain links within a html page. The following will find all href links on mypage.html: $nodes = $x->query("//a[@href]"); Whereas the following will find all href links where the description matches my needle: $nodes = $x->query("//a[contains(@href,'click me')]"); What I am trying to achi...

blue pay implementation

hi I want to implement blue pay payment method in my project. Is there is any tutorial to do this? I am new to the blue pay method; my project is in Zend framework ...

Disable a file include if it generates error (in php)

I would like to implement a simple plugin system for my script. I'll be including the files of the plugins which the user selects as available. Currently, if any of the files has some parse error, it causes the complete thing to go down, until I hack into the db to remove that plugin entry. Is there any easy way to do this? (Somehow ch...

Knowing the length of each sequence in a string

Hi, I have a string like this "0011100001100111", and i would like to know the length of each sequence (00, 111, 0000, 11, 00, 111), in the right order. How can I do that in PHP ? Thanks to who will help me. ...

Which PHP files are used and which are not

Hello, I got a large PHP website which Im now about to take care of. It contains hundreds of separate PHP files, but I suspect only less than a half is really being used. Most of them probably can be deleted. But the last thing I really want to do is going through the code of each file and check whether its linked, included, required.....

php extract image from piped email

This is an extension to a question which I asked some time ago. I am now interested in trying to get images out of an email piped to a php script. Where are they stored, or would they have to be decoded from the email? I know there are imap functions but can they be used reading from stdin. I really no nothing, any help would be apprec...

php in_array() not matching

The first array is called $related_docs and the second on is $all_docs. I'm trying to match the "1" value in the first array with the "1" value in the second array. Array ( [0] => 1 ) Array ( [0] => Array ( [id] => 1 [type_name] => bla1 ) [1] => Array ( [id] =...

Can anyone recommend an authentication library for CodeIgniter 1.7.x?

I've just started to play with CodeIgniter 1.7.2 and imendialtly noticed that there is not a built-in library for user authentication. I don't need anything fancy. It's only to authenticate users in to my back office system. I don't need users and groups, or permissions etc. I just need a script to allow users to login. If a user tries ...

best way to remove trailing slashes in urls with php

i have some urls www.amazon.com/ www.digg.com www.microsoft.com/ etc. i want to remove the trailing slash. so not just the last character. is there a trim or rtrim for this? or something fast? ...

Change the array KEY to a value from sub array

Hello, This is the set of result from my database print_r($plan); Array ( [0] => Array ( [id] => 2 [subscr_unit] => D [subscr_period] => [subscr_fee] => ) [1] => Array ( [id] => 3 [subscr_unit] => M,Y [subscr_period] =...

PHP Zip Archive organized in a Array

I am trying to organize a Zip Archive into an array so that I may extract certain files into their rightful place. The Zip contains 3 folder, and in each folder holds files that may be extracted depending on their extension. Zip -> Folder 1 -----File 1 -----File 2 -----File 3 -> Folder 2 -----File 1 -----File 2 -> Folder 3 ----...

functions.php vs OOP

if i have a collection of useful functions in a file called functions.php (easy enough) what would be the advantage of OOP? I want to learn it, but its pretty in depth so before I dive it, would be nice to know if there is an advantage. I can send variables to the functions just as easily as I can receive them. example i have function...