php

Making code work with register_globals turned off

I have inherited some legacy PHP code what was written back when it was standard practice to use register_globals. We know now that it is bad for security to have it enabled. The problem is how do I find all the places in the code where I need to use $_GET or $_POST? My only thought was to set the error reporting to warn about uninitiali...

Javascript and PHP - Login Script with hidden buttons

I have been using PHP and Javascript for building my dads website. He wants to incorporate a login system into his website. I have the design for the login system using PHP, my problem is how do I show buttons if the person is logged in. For Example - You have Home, Products, About Us, and Contact. Well I want to have buttons for Dea...

PDF Editing in PHP?

Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods. :) I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF? I have programmatically created PDF files in the past using FPDF, but found it a little unwi...

RSS feeds from Gallery2

After a couple hours fighting with the Gallery2 RSS module and getting only the message, "no feeds have yet been defined", I gave up. Based on a Google search for "no feeds have yet been defined", this is a pretty common problem. Do you have any tips and/or tricks for getting the Gallery2 RSS module to work? Or any tips for a relative...

What is PHP Safe Mode GID?

According to the PHP Safe Mode Docs on safe_mode_gid: By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access. To a PHP script running on a web server, what is the difference between ...

Class::DBI-like library for php?

I have inherited an old crusty PHP application, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects in your code, with the library generating accessor methods etc as appr...

Advancing through relative dates with strtotime()

I'm trying to use strtotime() to respond to a button click to advance -1 and +1 days (two buttons) relative to the day advanced to on the previous click. Example: It's the 10th of the month, I click "-1 day" button, and now the date reads as the 9th. I click the "-1 day" button again and now the readout states the 8th day. I click t...

Checking FTP status codes with a PHP script.

I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server status code from servers other than HTTP servers. How can I f...

Difference between NULL and null in PHP

Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not. edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" which was the whole reason I posted this question in the f...

Use for the phppgadmin Reports Database?

phppgadmin comes with instructions for creating a reports database on the system for use with phppgadmin. The instructions describe how to set it up, but do not really give any indication of what its purpose is, and the phppgadmin site was not very helpful either. It seems to allow you to store SQL queries, so is it for storing admin qu...

Integrating QuickBooks with your e-commerce site

I've recently been tasked with integrating QuickBooks with a custom built e-commerce site. What is the most painless way to go about integrating QuickBooks with my code? Are there any F/OSS or commercial software packages available that will simplify this process? Are there any F/OSS shopping cart solutions out there that include supp...

Running xinc on OpenBSD's Apache Server

Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted. ...

Run PHPUnit Tests in Certain Order

Is there a way to get the tests inside of a TestCase to run in a certain order? For example, I want to seperate the lifecycle of an object from creation to use to destruction but need to make sure that the object is set up first before I run the other tests. ...

PHP on IIS

Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows. ...

What's the preferred way to connect to a postgresql database from PHP?

I've been using PHP+MySQL for ages and am about to start using postgresql instead. What's the preferred method? Is it via the PDO objects or is there something better? ...

What are the proper permissions for an upload folder with PHP/Apache?

Sorry for the basic question - I'm a .NET developer and don't have much experience with LAMP setups... I have a PHP site that will allow uploads to a specific folder. I have been told that this folder needs to be owned by the webserver user for the upload process to work, so I created the folder and then set permissions as such: chown ...

Pie Chart Drawing in PHP

I would like to be able to create a pie chart in PHP. Are there any libraries that will allow me to easily create a pie chart from a list of names and percentages? ...

Tool to find unused functions in php project

Does anyone know of a tool that can find unused functions in a php project? I'm looking for a program that can scan a folder (and sub folders) containing php code and tell me which functions are never referenced. ...

How do I get PHP and MySQL working on IIS 7.0 ?

Okay, I've looked all over the internet for a good solution to get PHP and MySQL working on IIS7.0. It's nearly impossible, I've tried it so many times and given up in vain. Please please help by linking some great step-by-step tutorial to adding PHP and MySQL on IIS7.0 from scratch. PHP and MySQL are essential for installing any CMS... ...

PHP / cURL on Windows install: "The specified module could not be found."

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cURL working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: extension=php_curl.dll The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP script, I get this in the error log: PHP Warning: PHP Startup...