php

Why "not" Google App Engine?

I've heard of GAE and even though it doesn't support PHP, people have gotten around this limitation by using Quercus I think (I haven't tried it, but supposedly it works). But what factors should I consider when evaluating whether it's a match for me? For example, what made you not go with GAE? Or if you went with it, what are you not ha...

Zend Framework subdomain problem

Hi, I am using .ini file to add routes in my application. resources.router.routes.username.type = "Zend_Controller_Router_Route_Hostname" resources.router.routes.username.route = ":username.example.com" resources.router.routes.username.defaults.module = "userinfo" resources.router.routes.username.chains.index.type = "Zend_Controller_Ro...

Warning:chmod() [function.chmod]: Operation not permitted

When i use chmod() function to change permission on run time,it give me below message . Warning: chmod() [function.chmod]: Operation not permitted in /home/loud/public_html/readalbum.php How i can remove this error and make working of chmod function ...

[Solved]Rounding Mechanism to nearest 0.05

Hello Everybody, I would like to solve rounding mechanism by using php4,5.2 and below (not 5.3) Currently I am doing 0.05 rounding, something like this page: http://www.bnm.gov.my/index.php?ch=209&pg=657&ac=568 before rounding | after rounding 89.90 | 89.90 89.91 | 89.90 89.92 | 89.90 89.93 | 89.95 89.94 | 89.95 89.95 | ...

Get result of a JS file directly? (sorta AJAX related)

As I have known AJAX in the past, it has gone something like this: a server side language (in my case PHP) file generates xHTML has JS attached. The JS queries another file, with parameters set in GET or POST. This queried file's entire output is returned to the JS, which in turn makes a change on the original xHTML. Now, I'm trying to ...

CakePHP mathematic-calculation field?

(Database structure like http://stackoverflow.com/questions/1545764/cakephp-select-default-value-in-select-input) So, I have two tables in CakePHP: Trees, and Leafs. Every Leaf has a tree_id for its corresponding tree. Every leaf also has a numeric value. The default view that I baked for trees just lists all the trees in a table. I...

XMPP web client for commercial web application

I have the task of choosing an XMPP server/client solution for an internal web application. The goal is for employees to be able to utilize it via desktop client or the web application. The web client is mandatory. The web application is written in PHP, but I don't necessarily need a PHP solution. Flash or Java are acceptable (Flash ...

Create array from the contents of <div> tags in php

I have the contents of a web page assigned to a variable $html Here's an example of the contents of $html: <div class="content">something here</div> <span>something random thrown in <strong>here</strong></span> <div class="content">more stuff</div> How, using PHP can I create an array from that that finds the contents of <div class="...

PHP CRON job, not output HTTP headers

Hi All - I have a PHP script that is called via a cron job, with the results sent to my email address: "php /path/to/cron.php" I only echo errors, otherwise nothing is outputted by me. This way I can get an error report when things go wrong. The problem is, I receive an email with ever cron execution, that only has the HTTP headers...

Can I retrieve an aggregate column via the Containable behavior?

Is it possible for CakePHP's Containable behavior to request an aggregate column value during a find()? For example, in model Item containing numeric columns quarks and cogs: $this->Item->contain('quarks + cogs AS total'); ...

What is safest method to store passwords in a table?

Hi, I am using PHP. I used to use native mysql function password() to store passwords. I was told that password() is not safe anymore. What would be the best method to store passwords in PHP? is it MD5? ...

Running multiple system commands in background via php system() command?

I want to call a script on my server by opening a url. The script takes a long time to execute, so I want to run it in the background so there is no need to keep the browser open and worry about timeouts. It looks like the PHP function system() should work, but it isn't working for me. The script must execute from within the corre...

unable add namespace with php's simplexml

Hi , I am creating an atom feed , when I tried below to add xmlns:i as an attribute - $node->addAttribute("xmlns:i","http://www.w3.org/2001/XMLSchema-instance"); I got this as an output - i="http://www.w3.org/2001/XMLSchema-instance" "xmlns:" par was cut off. do I need to escape : char ? or is they any other way to add this namesp...

How to add textbox dynamically ?

Hello, please help with this criteria ? Users can be able to add as many Names as they can, ADD NAME link serves the purpose for this How can i handle this specification ? Please check the spec below: Thanq ...

PHP: Strange behaviour while calling custom php functions

I am facing a strange behavior while coding in PHP with Flex. Let me explain the situation: I have two funcions lets say: populateTable() //puts some data in a table made with flex createXML() //creates an xml file which is used by Fusion Charts to create a chart Now, if i call populateTable() alone, the table gets populated with...

Storing multiple dynamic values within one field in mysql.

How can i go about storing multiple values ( numbers and words ) within one field of a mysql database and then extracting them again as and when i need them using mySQL and php? for example: I want to store the dynamic values a user will enter using a form for example 1, 2, foo, tree, and monkey all in the same field in a database. the...

<?php vs <? ...Does it matter?

Possible Duplicate: Are PHP short tags acceptable to use? <?php //Some code ?> or <? //Some code ?> I know the first way is the proper way but PHP code isn't validated. So, besides it saving extra typing & bytes, does it matter? update Thanks for the replies... I had no idea they were called short tags (hence why...

How to split a string in PHP [solved]

Hello, I have a long string resulted from encoding a binary file -an image file- (in base 64). Is there a particulary method (or rule) I should follow when spliting it? Edit: I want to write the string to a xml file, but in order to do this I must split it in smaller chunks. Edit2: I would like to split it by length (I think that is more...

converting from base 10 to base 31 (working only with select characters)

I'd like to convert base 10 numbers to base 31 I would like to use only these characters: 23456789abcdefghjkmnpqrstuvwxyz As you can see, 5 characters are excluded (i don't need these): 1 0 o l i The function I have now is below but of course it doesn't work. When 2 is input it outputs 4. The output for tenTo31(2) should be 2 functio...

PayPal doesn't send me all fields to return url

I've setup subscribe form for PayPal. ... <input type="hidden" name="return" value="http://mysite.com/success/"&gt; <input type="hidden" name="rm" value="2"> ... Then I make a payment in PP Sandbox and click to "Return to Merchant" button. I expect: all transaction data in $_POST, such txn_type and so on I get: [merchantReturn_x] ...