php

Regex doesn't work with multi line

$regpattern4 = "!<media:description type='plain'> (.*) <\/media:description>!"; I am parsing an XML document. The above Regex works if there are no line breaks in the description, but how do I make it work even if there are line breaks? ...

Best way to Sanitize / Filter Comments from users?

I am currently using this process to Sanitize/Filter comment entered by users -> This one is used to strip slashes... and if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : st...

Good web based download manager?

I'm looking for a good web based "download manager" open source application. Mainly a web based interface to some files in a Linux server filesystem. I've looked in sourceforge and google can't find a good one. Maybe I'm searching it with the wrong keywords? PHP is preferred, but can be written in other programming languages as well. S...

PHP -> displaying unread GMail mail

Hello, is there a simple customizable script that I can use to display the unread mail in a GMail account? I don't know if I should use POP or IMAP to retrieve. ...

How to read the head section of a web page?

On my web page, when the user types in a URL in the text field, I wan to get some information about that page, like title or link information. Is there way to do it? On the client (JavaScript) or on the server (PHP)? And how? ...

What is the best method for testing URLs against a blacklist in PHP

I have a script that is scraping URLs from various sources, resulting in a rather large list. Currently I've just got a collection of if statements that I'm using to filter out sites I don't want. This obviously isn't maintainable, so I'm trying to find a fast and powerful solution for filtering against a blacklist of url masks. The be...

Snow Leopard: connect from local wordpress to remote db

I have a Wordpress-based log, hosted on Dreamhost. I'm on Snow Leopard and I wanted to install local site, that will connect to my remote database. However, this does not work and I get this error: mysqlnd cannot connect to MySQL 4.1+ using old authentication I did not try to do this in Leopard, so I don't is it new thing in SL or was ...

How to grab the view object from inside a Zend_Controller_Plugin Class?

I need to make a Zend Controller Plugin that repopulates a form with a request that is in every page on predispatch. just need to figure how to grab the view object from inside the plugin and if there are any specifics for plugins as far as file directory. Thanks. ...

How can I show NEW products per row from specific categories in Magento?

As the title suggests, I like to show new products called in from specific categories separated by rows in the home page. Row 1 -> New products from Category 1 Row 2 -> New products from Category 2 Row 3 -> New products from Category 3 ...etc In my Magento Admin CMS, under Home Page they will be called in as separate...

Switching to ColdFusion?

Hello, I am currently building an Adobe Air desktop app for a medium sized company and I truley believe that I could use this same app for many other 'like-companies'. It will greatly improve their efficiency and save them money; and hopefully make me some money too! :) I am in the process of designing the database structure and the lay...

open_basedir globally

I am trying to set open_basedir in php.ini globally to /tmp/ so that I need not remember to set it in each Apache Virtual Host directive. The second I set it in php.ini, all scripts fail to work, as only /tmp/ is allowed to be read. Is this not possible? The docs are not entirely clear, but it appears that it should work. ...

Is this a PHP function?

I saw this in a facebook leaked code... $disabled_warning = ((IS_DEV_SITE || IS_QA_SITE) && is_disabled_user($user)); now unless I am reading it wrong then it is saying that (($var) can be used as a function? ...

PHP + MySQL Web Stats

I wondering what ideas you guys had on the best method of doing some web counters backend. I will be tracking downloads via PHP, I'm looking at around 1.5 million "downloads" per day and all I will be storing would be "userid" and "downloadid". Possibly time too? What would the best way be? At the end of every day should I compile all th...

strlen, mb_strlen, which to use?

How can i know the character set in $_REQUEST ? and how to set the character set of $_REQUEST ? ...

PHP implementation of IdP discovery based OpenID?

Google have a very nice user friendly federated OpenID login with automagic endpoint discovery: http://www.puffypoodles.com/lso2 This is implemented in Java Servlets, is there a PHP equivalent that can be used in conjunction with php-openid? The discovery mechanism, XRDS, is covered in the following document: groups.google.com/gro...

Delete Directory in PHP?

how can i delete the directory and its all the files belonging in it with php? ...

can't install PHPUnit through pear

the install instructions for phpunit are running this: pear channel-discover pear.phpunit.de pear install phpunit/PHPUnit the first one goes okay , on the second I get an error: phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), installed version is 1.7.2 phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (vers...

Can a PHP script start another PHP script and exit?

How can a PHP script start another PHP script, and then exit, leaving the other script running? Also, is there any way for the 2nd script to inform the PHP script when it reaches a particular line? ...

PHP curl posting to aspx page causing 500 server error

Hello, This is a little complex question and a little hard to explain. We have build a script to auto login and collect the information from one asp.net based website, the script is in PHP using curl. We have been testing the script and it works 20-30% of the time which means the script is complete and works. But rest of the time it fa...

PHP Get hour difference in datetime

Hi, so I have these two time stamps in PHP 1253339331 1253338959 I want to be able to somehow get the hour difference between those to datetimes. Our users should only have 24 hours to login after their first attempt, so I need to find out if it's less than 24 hours to allow them to login again. ...