php

"unable to load dynamic library" Errors when running PHP from command line

When I try to run my script I at first I put the shebang in the script at the top and then tried this: php -f /home/phil/www/disable_script.php But I'm immediately greeted by this: PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/zlib.so' - /usr/lib/php4/zlib.so: cannot open shared object file: No such file or d...

Querying on Leads Status in SugarCRM Using NuSOAP

I'm trying to get back an entry list of leads by status. The query I'm using is "leads.status = 'New'" however when I try this in php, I get back leads of other statuses as well. function get_leads_over_x_days($session_id, $days) { $daysAgo = date("m/d/Y", strtotime($days . ' days ago')); $where = "leads.status=...

Good service for getting location by IP?

Which detect location most accurate. ...

Getting best array value based on a priority list

I'll try and explain this the best I can. I have an array called $linkSets, and it has array entires that look like: <string>,<integer> <string>,<integer> <string>,<integer> I also have a priority list, that goes in this order: 22 -> 18 -> 35 -> 34. I would like to check each integer in the $linkSets array, and get the best <string> ...

Loading JS configuration from server?

I want my JS to load certain information that needs to come from the server. Examples would be URLs, language specific messages, etc. What is the best way to get this information from the server to the JS? Right now, I have such values stored in an actual JS file. I don't like this approach because information is duplicated on the serve...

How to send and receive headers via PHP

I'd like to study how headers are sent and received. I know about PHP's header function and think I can just look at an actual request header (e.g. using Firebug) and make identical requests to a server (including spoofing the User-Agent). Is this correct? The other problem is how do I get the header responses back? I want to analyze t...

How to use gzip compression in apache for html, css and js files?

Hello When an Apache server supports gzip compression, how can from PHP send a CSS file to the client. Is this using .htaccess or with a library? If is a simple .htaccess line, do provide it! Thanks a lot ...

How to deal with Apostrophe while writing into Mysql database

I am getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's','portal','','offering','MSNBC','News','','sports','','MSN','Money','','games'' at line 3 The only problem is that this error shows up when inserting data that contains a...

execute java program in the background while loading a page using php

I am trying to run a java program in the background using php. I am able to the run the program but the page doesn't load till java program completes executing. I am able to run shell scripts in the background using php. But if i give the same command for java, it doesn't run in the background. $command = "java hello"; $outputfile = "o...

Internal rewrite+Setting environment variables with mod-rewrite/.htaccess

Hello, I am trying to achieve the following through mod_rewrite: 1. What is the basic directory structure? / main/ (folder) a bunch of PHP files some_folder/ (folder) another_folder/ (folder) ... (an arbitrary number of such folders) yet_another_folder/ (folder) .htaccess(the magic goes here) 2. What I am trying to do? In thi...

Read a line from a text file, then delete it

Hello, I have a text file , filled with pipe separated URLs, like this: http://www.example.com|http://www.example2.com|http://www.example3.com|.... etc. I currently have this code to read each url from the file and pass it to a function: <?php $urlarray = explode("|", file_get_contents('urls.txt')); foreach ($urlarray as $url...

OAuth - Consumer secret in open-source applications

I'm creating a Wordpress plugin for collectively managing a Twitter account. I want to allow the user to add accounts via the Admin panel similar to the way twitterfeed.com does. However, the only way I can see of doing it is to get the user to sign in to their account, register the application under a unique name and paste in the ...

Are my Magento permissions correct?

I have a fresh install of Magento 1.4.1.1 using MAMP 1.8.4 on OS X Snow Leopard 10.6.4. I'm unable to load magento/downloader (the Magento Connect Manager) successfully. My browser displays a blank white page. Safari's Activity window tells me it's an Internal Server Error, which tells me my permissions may be incorrect. I have changed ...

Socket Error using localhost

Hello I am using xampp & i wnat to mail form localhost . so for that i confige PHP.ini & sendemail.ini all time in bowser so nothing in error but in mail debug file show me Socket Error # 10049 how can fix thsi issue. i try a lot. in my machine i have Windows 7. Kindly help me ...

Multilingual Site in Zend Framework

Hi, i am working on a site to include Multilingual Support. I can translate strings using Zend_Translate but what about the content?? For example do i have to add multiple records for same product's for each language? Or is there any other way? I am new to multilingual please help. Thanks in advance. --- Addition -----------------------...

PHP getting information about an object

If I have an object, how can I know the details of the object. Like the file in which it is defined, its methods, properties etc. ...

which is best way for making form in zend framework

It is possible to make form and table (View) by both using zend_form with decorators, validators , filters etc, and we can also do this directly in view phtml file writing html as usual. I want to know which one is the best way to do in terms of Performance Time Simplicity I am new to zend framework. ...

"Rounding" colour values to the nearest of a small set of colours

Preamble As a part of a project I'm working on I am trying to provide a convenient way to search for images in our system. We currently provide searching by various types of user added metadata (e.g. title, description, keywords) and by various metadata which we extract (e.g. EXIF, IPTC, XMP, etc). I would also like to add a "colour s...

PHP - CMS - Framework

I am currently working on PHP sites (80% work is on heavy database queries) and also working with Zend Framework. In my 2 yr development experience I never worked on any CMS like Wordpress, Magento but I have idea how they work. Shall I continue with what I am doing or shall I switch myself towards CMS. Guide me which one is beneficia...

how to transfer big files using webservice api in wordpress or php

how to transfer big files using webservice api in wordpress or php? Thanks in advance Naveen ...