php

Codeigniter - Blank screen when trying to retrieve 8500 records

Hi, I am trying to display a table which contains 8500 records, I am using the same controller/model functions as I have used throughout the site which all work fine. On this page however, I just see a blank screen. Is this a known Issue with codeigniter? Is there a work around? I am totally stumped, my only option I guess is to split ...

filter_var or custom function for email validation in php

Which solution is better, using the built in validation filter_var('email', FILTER_VALIDATE_EMAIL) or a custom function? Thanks! ...

php upload file class

hi all, i am new to php i am in search of a php function in a class that accepts some parameters like size,type etc the class should be such that it should be able to set some default values to the parameters that are not assigned by user for ex the destination folder etc can anybody give me a link or some hint how should i do this ...

php regexp for get images

Possible Duplicate: Regex to change format of all img src attributes Hi, I want to replace the image path in my content db field. I have the following preg_replace("/src='(?:[^'\/]*\/)*([^']+)'/g","src='newPath/$2'",$content); which is working fine for src="/path/path/image.jpg" BUT fails ON src="http://www.mydomain....

PHP DOMDocument: How to get direct node childrens

Hi, I've got the following: http://pastie.org/1066861 I've got a Javascript function, that tells me to delete a given node from the parent, let's assume position 1 ( from 0 or 1, since we've got two child nodes on parent ), When doing $parent->getElementsByTagName and trying to remove the the $child->item( 1 ), I notice that PHP GetEle...

PHP: Function to shard/distribute (consistent hashing) ?

Hi everybody, I have thought a bit about making a somewhat lightweight consistent-hashing-like PHP function to shard uploaded files between different servers. Obviously, rand() would work to distribute the files among the servers somewhat evenly, but when requesting the files, no one will know which file lies on what server... I know ...

how to manage filenames for gallery?

Hey all together, the procedure: i have a script which uploads images (via hmtl-form and php) for a gallery for something you can sell on the internet. the uploaded files are stored to some temp folder. if the customer pays for posting the object online, a daemon, who crawls the directories, will then get the pictures and scale them t...

CURL working from localhost but not on live site

I have a CURL code that fetches some XML content from a remote server. I get the expected output on my localhost (XAMPP on windows). But from the live site(hosted on Linux), I get the CURL error:'couldn't connect to host'. function DownloadUrl($Url, $p){ // is curl installed? if (!function_exists('curl_init')){ die('CURL is not...

Get duplicate entries from a table

How can I get rows that were inserted more than once from a table? I allow my site users to have only one account per email but my script had a little bug so users where able to register more than once with the same email address. I want to get all the emails that has been recorded more than once. How is that possible using php/mysql? ...

MySQL + PHP (grouping by date)

I'm trying to output a list of different itmes grouped by the date they were stored in the database (unix timestamp). I'd need help with both MySQL (query) and PHP (output). MySQL table id | subject | time 1 | test1 | 1280278800 2 | test2 | 1280278800 3 | test3 | 1280365200 4 | test4 | 1280451600 5 | test5 | 1280451600 ...

Convert number to letter with php

Hello, I'm programming an invoice script. I'm looking for a php script that convert number to letter. Exemple, the invoice show this value : 155€ The script put automatically: ONE HUNDRED FIFTY FIVE Any ideas ? Thank you :) ...

ZipArchive php class extract files as root. Why?

I have a php script: $extract_dir = "./"; $extract_file = "extractME.zip"; $zip = new ZipArchive; $res = $zip->open($extract_file); if ($res === TRUE) { $zip->extractTo($extract_dir); $zip->close(); echo "ok"; } else { echo "failed"; } But when I execute this script, via http://www.mywebsite.com/extract.php All the f...

How can I create Zend Form Element extends A html tag not INPUT

How can I create Zend Form Element implements A html tag not INPUT. I need create something like that: $Link = new Zend_Form_Element_Link( $field_name, array( 'label'=>'THIS IS LINK', 'href'="#", 'other_attrs' => array() ) ); Do I should use loadDefaultDecorators function or either? This Link element is not actually related t...

How can I convert a double value to time?

How can I convert a double value to time? For example, if the input is 7.50 then the output would be 7.30. ...

Debugging curl_exec

Hi I have been having a very difficult time recently debugging a curl function within our paypal ipn module. Here's the module we are using: http://www.oscommerce.com/community/contributions,2679 But the relevant code is below. I am experiencing this error for about 5% of our transactions. It causes orders not to be updated to a paid ...

In PHP,implementing a two dimensional array

For example I have a two dimensional array... a[0][1]=x a[0][2]=y a[0][3]=z ........................ a[1][1]=a a[1][2]=b a[1][3]=z .......................... I want x,y data in blue colour I want a,b data in green colour I want z to data to be in voilet colour.....How will i do this in php Can anyone explain this with an examplle I h...

Deploying minified versions JS/CSS using Netbeans

I'm a kind of big rookie, using Netbeans 6.9 as a PHP dev tool. Currently I do develop and test locally on my PC using XAMPP/Apache/MySQL and once done, use Netbeans "upload" facility to the production server on the web. I was wondering if there's a Netbeans tool capable of minifying js/CSS files on upload, or a tool to minify the whol...

PHP : imploding array and storing the result back to same variable

Are there any pit falls in the below code . Is it safe to use this way. I will not be using the array again $records_msg = implode(" ",$records_msg); ...

facebook app - auto add tab when app gets installed

hi everyone, is there a way to automatically add the tab of an application to the users profile page, after he installed the application? thanks in advance ...

If page called directly then throw 404

I have created a page on a WordPress site called AJAX which lives here: domain.com/ajax/ This page is used for AJAX calls. What I want to prevent is direct access to it, so basically allow JS to call the page but if someone types in the url and tries to access it on its own then they will get a 404 (basically making it as though the page...