php5

"Admin module" taking over [Yii framework]

Hi I have an "admin" module and I want it to serve "dynamic controllers", i.e. to provide a default behaviour for controllers which don't really exist ("virtual controllers"). I've invented a lightweight messaging mechanism for loose communication between modules. I'd like to use it such that when e.g. ?r=admin/users/index is reques...

Why Isn't this define variable sticking in PHP?

Can someone explain to me why in the world my DB_PREFIX variable is not accessible? When echoed, it just prints out DB_PREFIX to screen. All of my other defined variables are being printed to screen just fine, when called of course. Help? debug.php require_once('db/config.php'); $conn = mysql_connect(DB_HOST,DB_USER,DB_PASS); mysql_s...

uploadprogress.so for PHP 5.3?

I'm using XAMPP (latest version) on OS 10.6.2, that's bundled with PHP 5.3.0 I installed the XAMPP development package for the PHP source/header files and ran the following command from Terminal- sudo ./pecl install uploadprogress Everything appeared to work fine. My php.ini file (yup - I checked it's the same one being loaded in php...

PHP CSV export function

I am trying to export data from my MySQL database to multiple CSV files and then GZIP them. I have a couple of problems which make exporting it to a CSV file complicated ... Several fields (10) need to be in 1 CSV file Other fields (multiple!) are serialized and need to be exported into a different CSV file with two other non seriali...

Why cant i set $_SERVER['DOCUMENT_ROOT'] as Attribute?

Why cant i set $_SERVER['DOCUMENT_ROOT'] as attribute? see example code class foo { private $path = $_SERVER['DOCUMENT_ROOT']; // generates error private $blah; public function __construct() { //code } public function setBla($bla) { $this->blah = $bla; } } ...

In PHP5, how do I create a multidimensional array from a database query?

I am creating a class for an application "backbone" and I need this function to query the db, and return a multidimensional to look like this: $myArray = ("name"=>"John", "dob"=>"January 5, 1955"); Of course the data for the array is from a database query. but, "name" and "dob" would be the database column name and "John" and "Januar...

How to update php-imap on Centos 5.4?

phpinfo: imap IMAP c-Client Version 2004 SSL Support enabled Kerberos Support enabled But imap_header() was crashed on this version library. http://bugs.php.net/bug.php?id=20254 and other Please, help me to update libc-client and php-imap on Centos 5.4 (php 5.2) ...

PHP - Date function - finding the previous week

Hi, In my application a week is defined from Monday 12:00:00 AM to Sunday 11:59:59 PM Whenever a user visits my site - I need to find the previous weeks date range and show him results based on that. It sounds simple but I'm lost. To give you scenarios - - March 1st Monday 12:00:00 AM to March 7th Sunday 12:59:59 PM is the week. Now w...

how to organize files created dynamically using php ?

Hi, I have an PHP website which creates and stores HTML template files on server based on user input.one user can create many templates.So to store the template files and associate them with the DB record ,what I do is- "templates" is the table which hold other information about the template such as who created it etc. with unique auto...

Symfony + doctrine + one-to-many relationships

Hi everybody. I need a one-to-many relationships for my sf 1.4 + doctrine 1.2 project. I copied the relation just like this: User: columns: id: type: integer(4) primary: true autoincrement: true contact_id: type: integer(4) username: type: string(255) password: type: string(255) Ph...

Running PHP scheduled task through Windows Apache Module....

Okay, so we have this site that we took over from a previous firm...PHP, Zend Framework, MySQL etc. It's an interesting site in that they utilize a CMS that's external (they manage some data like forums, user subscription, etc.) So there's a library that communicates via web service calls from PHP to the CMS, and then from JavaScript i...

What's a good free php editor?

Possible Duplicate: Any good PHP IDE, preferably free or cheap? Currently I'm using Notepad++. It's a great editor but there are 2 things I'm missing: autocomplete and debugger. I'm looking for a PHP editor that supports: autocomplete for PHP functions (for 5.3). It would be great to have a feature to autocomplete class mem...

PDO PHP query against Teradata using ODBC connect string returns no data from 5th column onwards

I'm using PDO to extract data from Teradata, using an ODBC connect string. The query returns the correct number of rows but column 5 onwards is blank (as compared to using the same query with the PHP ODBC library) Column 5 happens to be a varchar(400) field and I've read that PDO had bugs in the past with varchar columns > 255 in lengt...

Is it good to store dynamically created file's paths in database ?

HI This is in reference with my earlier question http://stackoverflow.com/questions/2361723/how-to-organize-files-created-dynamically-using-php I edited the question , with one more aspect, that is storing paths in to the DB.are there any advantages or disadvantages of doing this ? ...

how to call a static method in a custom magento class

I have a custom model in a custom Magento model with a static function: class ABC_Module_Model_ClassName { static public function send ( $something) { // do something static } } Now I call the function like this: ABC_Module_Model_ClassName::send($something); // works and is nothing wrong with it More for consis...

How to POST PHP to remote ASMX server

I need to make a simple "Hello World" script in PHP that I then need to post to a remote ASMX server. I've already established a connection between PHP and the server by pulling all the arrays from the ASMX server in PHP using cmd. How wohuld I send my script to the ASMX server so that it can be executed there? ...

How to remove $_SERVER['DOCUMENT_ROOT'] from a given string in PHP

How can i remove $_SERVER['DOCUMENT_ROOT'] from a string like this /home/bla/test/pic/photo.jpg the result should look like this /test/pic/photo.jpg I also need to take the photo.jpg from /test/pic/photo.jpg How can i do that i PHP? Thank ...

How to know the actual codification of a text stored in a MySQL table field?

Hello guys, I have a very simple question. I just need to determine the codification (UTF8, latin1) of a text stored in a MYSQL table field. Thanks for you help! Guillermo ...

Why are objects being turned into strings when other unrelated objects are serialized?

The server at my old employer was rooted this past weekend and apparently the server provider made changes to the server which is affecting the PHP code. The issue that has arisen is related to serializing objects. The objects being serialized, and other objects not being serialized, are being converted to strings thus breaking the code...

PHP - Error parsing a string with code

I'm having a problem with some code that used to work in PHP 4.X and is not working in PHP 5.2.4 First of all, there is a small example of a code similar to the one is causing the problem. Unfortunately, I haven't been able to reproduce the problem with a small example. <?php class Example{ public function showExample() { $ind...