php5

Limiting RecursiveIteratorIterator() recursion depth

Hi everybody, i'm using RecursiveIteratorIterator() to explore subfolders of my current path, but in this way all trhe tree is explored, instead i want just the direct childern of my fodler to be explored for files. How can i say to RecursiveIteratorIterator() to not go much further and stop to the first subfodlers of the current folder...

Integrate Zend Framework With Legacy Application

Is it possible to integrate Zend Framework with already existing legacy web application? The application is written horribly using so called spaghetti code (no separation between presentation and application logic, PHP, HTML and SQL are all together). It is a very large application with hundreds of pages and forms. Does it make sense to...

MySQLi as an static class

I have the following code that is able to create a class that has a single static instance of the database object, and two static functions for rows and columns. <?php class Database{ private static $instance; private function __construct() {} private function __clone(){} public static function call(){ if(!iss...

fill out a form automaticly using curl and php

Hello everyone! I am trying to write a script that fills out form automaticly and then automaticly press the submit button. I have read that you can use Curl to post http requests, but how do you do if the form handles the post-request with javascript, like the code below? <form name="myform" action="javascript:void(0)" method="POST" ...

How to import gmail contacts using PHP?

I have to create a tell a friend section in my web site. How to import gmail contacts using php. any body can help me. ...

How should I pass a MySQL database link to a class in PHP?

Hey all, I'm trying to make a small CMS for fun but I'm getting caught up on some semantics with OOP. I have a basic database class and then I have an administrator class. The admin class has to make database queries, so what I've been doing is having the admin class extend the db class and then passing the link to the db resource via c...

Serialize objects that contain utf-8 strings

How can i serialize objects with fields that contain utf8 strings? Now i get back false after unserialize. ...

Create a new copy of object itself with some new properties

Sometimes it's difficult to explain in human language what you want to do in programming, but I will try... Please explain to me, how can I implement the following logic. Suppose we have a template class: $obj1=new Tmpl($somevar1, $somevar2, ...); //we then add a new file to template //as we don't have any files yet, new object won't c...

Default value of member variables

What is the default value of class member variables in PHP? Why do I often see: public static $variable = null; Wouldn't it be enough: public static $variable; ...

How to stream video in php

I have to stream videos in my php site? how to do that. any body knows any free flash player given sites link. Please help me. ...

face book graph api

i wnat know how to authentication done in server side for face book in "graph api"(oauth athentication) ...

How to validate phone number using PHP?

How to validate phone number using php ...

php dynamic creation nested divs

hi i would like to create nested divs dynamically, preferably without javascript so if you have n divs, div1 contains div2 which contains div3 which etc ... how could I code that in php ? Tom ...

Zend problem with a form

Hi every one first of all im new in zend and i need some help to start. My problem is I have a login for like this <form action="<?php echo $this->baseUrl ?>/user/login" method="post" id="login"> <input type="text" name="username" value=""/> <input type="password" name="password" value=""/> <input type="submit" name="submit...

PHP5.3 non-static variables in scope behaving static

Do PHP5.3 have any known bug issue that makes non static variables in scope behave Static ? I donno why in a if{}Scope I've { echo $_not_static; $_not_static = 5; } First Time it fires E_NOTICE as it should But second time it prints 5. I was Struggling with this for 3+ hours but not getting any hint of a fault from my side. ...

Need aptitude questions for php preparation

Hi All, I need to prepare for PHP aptitude exam. I have searched on Google but I am not getting proper stuff for PHP aptitude. I have some stuff of zend certification ( covered most of the concept ). Needed other stuff apart from zend certification. Can any one provide me any links which has PHP aptitude questions ? Thanks in advance ...

php: Database accessing Error

Hi all, I have used "DB.php" package to do the database operation . In my file I have connected the database and access the table values. It is working fine. when I am running in command line interface . But When I am running that php file in web browser it telling me following error Note :I am Using pgsql database Can't connect...

Using flock() to lock a stream is only assured to work under what circumstances?

This is a question from PHP zend exam, Using flock() to lock a stream is only assured to work under what circumstances? When running in a Linux environment local filesystem When accessing the stream of the local filesystem When running in a Windows environment and accessing a share When accessing a bi-directional stream When accessing...

How can you modify the copy of an object during a clone operation?

How can you modify the copy of an object during a clone operation? ...

Php zend framework forcedownload

Hi, I should set up a simple download manager and I don't understand whay this code doesn't work: protected function doDownload($filename){ //$this->_helper->layout()->disableLayout(); //$this->_helper->viewRenderer->setNoRender(true); $dir = Zend_Registry::get('dir'); $file = $dir->assets.$filename; ...