php5

PHP generate id from 1-36 for dinamic div?

How to generate id for dinamic div tag using php or jquery? example: php generates 36 divs, how to set each div unical id from 1-36? ...

Exception instead Notice

Hello, I have two classes: class Test { public $name; } /*******/ class MyClass { private $_test = NULL; __get($name) { return $this->$name; } __set($name,$value) { $this->$name = $value; } } And when I want to use it this way: $obj1 = new MyClass(); $obj1->_test = new Test(); $obj1->_test->name = 'Test!'...

MySQL ND SSL in PHP5.3.3

According to http://www.php.net/manual/en/mysqlnd.overview.php MySQLND now supports SSL Does anyone know of any examples of setup of an SSL connection with MySQLND? Is the assumption that you just use the existing mysqli route but under the hood it's using MySQLND? ...

How do i assign values to the Select Box or hidden value retrived from function

Iam calling a PHP custom function with different parameters which returns a different arrays based on parameters . //Array1 array(1) { ["INDEX_NAME"]=> array(1) { ["XEROX PRINT "]=> string(8) "XEROX VALUE" } } //Array2 array(1) { ["INDEX_NAME"]=> array(2) { ["XEROX PRINT"]=> string(8) "TEST2" ["XEROX PRI...

zend framework: wait for query to finish before starting another

In a web app I've created in zend framework, I'm creating a new database for every new client that registers. This query of course is rather heavy and time consuming since we need to create a database, create some 10 tables and put some data in the tables. We are using one large SQL file that we read in and exec(). After those queries...

Using Facebook Open Stream API with PHP

I'm interested in using the Facebook Open Stream API to read a users Facebook news feed in my PHP web app. I'm interested if someone with API experience can answer the following; Am I right to use Facebook Open Stream API? Where is the most comprehensive documentation. Is there a PHP library I can use? ...

In Magento, how do you filter a product collection by the manage_stock field?

I've built an inventory update script - where I fetch a product collection in Magento, and iterate through the result set, updating product inventory (based on a separate inventory feed) as I go. I can fetch the product collection no problem. However, I only want to get products which have the "Manage Stock" field (a dropdown in the ad...

Why are my cookies getting deleted when i close browser - PHP ?

this what i'm using to set cookie setcookie("remember", $code, time()+1209600, "/", ".$domain"); And this is working, when i close the window but why are the cookies getting deleted from client machine when i close the broswer ? I've set for 1209600 seconds - 2 weeks. when i close my browser, i'm not able to see the cookie...its get...

PHP- Best Obfuscation Tool/Script?

Possible Duplicate: Code obfuscator for php? Hey, I am needing a PHP obfuscation tool or script that prevents people from decoding or reading it. What is the latest and best one so far? I heard of IonCube but theres decoders for it. It has to work with Curl/PHP coding. It has to be hard to crack or uncrackable. ...

Strange MySQL error "Empty row packet body" when using mysql_fetch_object (PHP 5.3.3)

Hi to all, i get a really strange, pointless and totally random error when i fetch rows from a resource (query) using PHP. My development machine is a Windows XP SP3 with Apache 2.2 while MySQL runs on a virtual machine, using ubuntu 10.04, with 768mb of ram, 100gb of hdd and 4 logic cores (intel q6600). However this problem is not rel...

Question about sending a request to another site that has a callback that targets my original page

Hi, In my test.php file, I sent a request to a Flickr app I have using header("Location: " . $request); where $request is the URL that I am trying to reach on Flickr. For my Flickr app, I have to set a callback URL. When Flickr is done with processing my request, it will call the callback URL. I would like the callback URL to be my...

No error or warning when attempt to access property of non object (not assigned)

Can somebody explain to me why PHP does not report a warning or error when accessing a property of a empty object (var is not assigned)? For example: $oMyObject->test = 'hello world'; // $oMyObject is not assigned but no warning or error When i do this, it produces an error: $oMyObject->test(); // Error: Calling function on non-obje...

How many man hours should I ask for this almost-facebook clone?

I am asked to prepare estimates for an application with the following must-have features. Login, including several hierarchical user access levels. Chat amongst users allowing the user to become invisible. Ability to post a public message, video, voice recording, image or draw an image using flash based sketching environment. Ability t...

Partial in layout error

So this is my project directory structure: application/ layouts/ scripts/ default.phtml partials/ partial.phtml modules/ default/ controllers/ models/ forms/ views/ scripts/ public/ In the default.phtml layotu I'm trying to include a pa...

How to limit number of processes?

In my PHP web application, I am trying to limit the number of CPU/memory intensive processes that run (for example, ImageMagick's 'convert' command). I have a number of crons jobs that execute various scripts that could potentially execute too many instances of these CPU/memory intensive processes. In my attempt to limit such processes,...

php sort array with preference

Hi, I have array and contains 50 values , example london,bluehit,green,lonpark,abc,aab,lonsee i want to sort as per my preference , i give one argument , example if i give arugment as lon then my array should form like london,lonpark,lonsee,aab,abc,blurhit,green,lonsee , so in the above my array output is i gave parameter as lon ...

How to create temp table from tags?

I have a product_table with a product_id among several other fields. I am creating a tag_table with 2 fields, tag_id and tag_name. The tags could be anything like "silver" or "penn state" etc. I am also creating a product_tag_map table with product_id and tag_id in order to map a product to any number of tags. If I wanted to create a...

How to set object /variable to request scope using PHP

Hi, I am java, j2ee developer. But new to PHP lang. In Java Controller and Jsp , there is provision to add object in request attribute. like this .... request.setAttribute("Object_key", Object); Is there is such kind of provision in PHP, which add object/Variable in request. So these objects/Variables are available to next view pag...

Creating array from string.

I need to create array like that: Array('firstkey' => Array('secondkey' => Array('nkey' => ...))) From this: firstkey.secondkey.nkey.(...) ...

PHP - How to send emails to address on MYSQL?

Hey, How can I send emails to all emails on my database? E.g. here is my format of MYSQL. MYSQL -- Table = users --- column = email. I need to send emails to everyone of the email on column "email". Thanks if anyone can help me out. ...