php

Finding a subtree in a CakePHP Tree

In CakePHP, how do you select just a subtree in a model which actsAs tree? I tried this, to find the tree headed by the item with label = "My Label" $this->find("threaded", array( "conditions" => array( "label" => "My Label" ) )); ...however looking at the logs, it runs this SQL: SELECT Menu.id, Menu.parent_id, Menu....

What's the best PHP library to develop GUI programme?

php-gtk and JeCat ? Is there a better choice? Further more,what's the current most pupular way to develop GUI programmes with PHP? What's the procedures and related software utilities? ...

How to run PHP exec() as root?

I'm trying to build a firewall manager in PHP, but when I execute, <?php exec('iptables -L'); ?>, the result array is empty. I have tried, <?php echo exec('whoami'); ?>, and the response is www-data (the user that Apache is using). What can I do to execute the exec function as root? (Preferably without changing the Apache user.) ...

How would I start to build a subscription module with Magento?

I need to create a subscription module on magento. I created a module call subscription under a custom namespace in the local folder. I have register it with magento, so, I'm good to go. I want to be able to extend core Catalog_Product and add a couple new fields that relate to subscriptions, like trial period, charge date, and other sub...

Anyone do step-by-step PHP debugging on a Mac with Textmate & local test server (Not MAMP/XAMPP)?

Hey all, What do you all use? I'm getting sick of vardumping everything, I just wrote this massive function that isn't quite working correctly. I would love to be able to step-through the php code. I heard macgdbp was pretty good, but it seems like its iffy unless you use MAMP. This is for mac users who develop with Textmate and took...

PHP/MYSQL: SELECT statement, multiple WHERE's, populated from database

I'm trying to figure out how to get a select statement to be populated by an ever-changing number of where's. This is for an order-status tracking application. Basically, the idea is a user (customer of our company) logs in, and can see his/her orders, check status, etc. No problem. The problem arises when that user needs to be associat...

Warning: date() [function.date]:

Does anyone know where I can read the documentation for the solution to this warning. I can search for the warning and I just get a phonebook's worth of pages that have the same problem. Anyone? Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting...

Need to carry on browser "session" when calling another php script through CURL

I have a "primary" PHP script (actually a set of scripts) all of whom the user interacts with through the browser. I've had no problems using the site as the session information works from page to page. However, one of the scripts needs to directly call another "secondary" php script on my site using CURL and that "secondary" script nee...

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\

Hi I keep getting this error, and I changed the sendmail in the php.ini to: sendmail_from = [email protected] $to='[email protected]';//assigns the email address to the reciever part of the script $subject='User Comments OHBS.com'; $header='test'; $name=($_POST['Name']); $email=($_POST['Email']); $Question=($_POST['MessageTi...

Is it possible to use conditional operator in checkbox using flex ?

I want to fill color based on condition so I used conditional operator for the checkbox. But it's shows the error Implicit coercion of a value of type String to an unrelated type Array. What did I do wrong ? How can I dynamically change the color of a checkbox ? <mx:CheckBox id="home" enabled="false" fillColors="{(data.actualwin != '...

File download time in PHP/MySQL

Hi friends, I want to find download time in PHP by sending a request to my MySQL server. I have one table with an href link to download the file. If I click download the download time should show beside the file name in a table. Can anyone please help me out? Today is my deadline. Please check out my code: <?php $con = mysql_connect("lo...

Convert numbered to accentuated Pinyin?

Given a source text like nin2 hao3 ma (which is a typical way to write ASCII Pinyin, without proper accentuated characters) and given a (UTF8) conversion table like a1;ā e1;ē i1;ī o1;ō u1;ū ü1;ǖ A1;Ā E1;Ē ... how would I convert the source text into nín hǎo ma ? For what it's worth I'm using PHP, and this might be a regex I'm l...

How to work with multiple word resources in Zend_Tool

So I've got a controller that I want to be camel cased: MisterFoobarController So I created it like this: zf create controller mister-foobar which created something like Mister-foobarController.php but inside of it created it correctly as MisterFoobarController. How do I create camel cased multiple word resources with the Zend_To...

Automatic PHP Documentation Generator

I am looking at any document generator for PHP that can actually read the source code and generate the documentation - instead of writing comments according to what the generator needs the format to be like. I've looked at phpDocumentor and several other documentation generators: all require the need of writing comments into the source ...

What's the best way to learn mvc in PHP?

I'm totally new to mvc,how to pick it up? ...

Exception Problem when using Google Documents List Data API with PHP

Hi, I am trying to upload, download documents and spreadsheets using Google Documents List Data API with PHP. I gone through the documents and FAQ's. Only version 1.0 is available for sample using php in Google Documents List API. When i am registering my localhost domain with google domains it says not verfified even i tried with both m...

PHP: word definition script?

I am developing a web page in which I am accepting input words from user and when user will submit those words then I want to display definition of those words or wikipedia link of those words for more definition about that word. Something like below: Let's say user enetered 5 words: toast, egg, beans, coffee, tea Now I want to displ...

Invalid OAuth Signature returned while using Yammer Api

I am trying to write a small webapp that pulls data from Yammer. I have to go through Yammer's OAuth bridge to access their data. I tried using the Oauth php library and do the 3 way handshake. But at the last step, I get an error stating I have an invalid OAuth Signature. Here are the series of steps: The first part involves getting...

Error while uploading file in PHP

Hi, While uploading the file in php i am not able to upload all types of file, if any space is there in between file name that is not able to download. Please can anyone correct this code here is my upload code <?php $target_path = "../mt/sites/default/files/ourfiles/"; $target_path = $target_path . basename( $_FILES['uploadedfile']...

How to get MySpace profile info using OpenSocial client library?

Any advice on how to get MySpace or Orkut info such as birthdate from a person's profile using OAuth using the OpenSocial PHP Client library? I am lost on the process, and the tutorials are complicated. Any simple code would be helpful! Thanks. ...