php

How would I log every function call the PHP interpreter makes during a given script?

Can I configure mod_php, XDebug, or Eclipse (or some other free program) to print to file the code that is executed? And if so can I limit it to function calls to keep it somewhat readable? ...

How do you query posts from more than one author in Wordpress?

How do you query posts from more than one author in Wordpress? something like: query_posts('author=9,10&post_status=publish&orderby=date') This is not working though. ...

PHP-How to choose XML section based on an attribute?

All, I have a config xml file in the following format: <?xml version="1.0"?> <configdata> <development> <siteTitle>You are doing Development</siteTitle> </development> <test extends="development"> <siteTitle>You are doing Testing</siteTitle> </test> <production extends="development"> <siteTit...

Choosing a plotting library for web/browser application

Hello, I am looking for a plotting/graphing library (mostly to do line plots) for my application. I have been looking at JavaScript APIs (like Google's) but I found them to be slowing down things at client side (I am plotting a quite large number of points). I also found that with client-side libraries, the performance was quite varied ...

Semantics of setting cookies and redirecting without getting header error

I would like to do the following in php : setcookie('name', $value, $Cookie_Expiration,'/'); then some action header("location:http://www.example.com") the problem is that I get : warning: Cannot modify header information - headers already sent by (...etc ) could you please let me know what i am doing wrong and if there is a way t...

How to use default arguments in php

I want to define a function doSomething(arg1, arg2) with default values to arg1=val and arg2=val When I write function doSomething($arg1="value1", $arg2="value2"){ // do something } Is it possible now to call doSomething with default arg1 and arg2="new_value2" ...

Why do PHP Array Examples Leave a Trailing Comma?

I have seen examples like the following: $data = array( 'username' => $user->getUsername(), 'userpass' => $user->getPassword(), 'email' => $user->getEmail(), ); However, in practice I have always not left the trailing comma. Am I doing something wrong, or is this just 'another' way of doing it? If I was using a framework woul...

Creating a file/folder structure and zipping it up?

I have a directory of image files and I need a php script or shell script that will rename them, create a structure of nested directories, and then insert each image into a specified place in the directory hierarchy. Ideally I would just specify a parent directory for each file and a parent directory for each directory and it would build...

Should XML be used server-side, and JSON client-side?

As a personal project, I'm making an AJAX chatroom application using XML as a server-side storage, and JSON for client-side processing. Here's how it works: AJAX Request gets sent to PHP using GET (chat messages/logins/logouts) PHP fetches/modifies the XML file on the server PHP encodes the XML into JSON, and sends back JSON response...

Kohana 3 - How do I make the Default Route pass arguments to the Controller's Action?

My controller action requires a parameter, but I can't get KO3's router to pass this parameter in the Default route. This sort of thing works with other routes. Here is an example to clarify... In bootstrap.php... Route::set('default', '(<controller>(/<action>(/<the_required_param>)))') ->defaults(array( 'controller' => 'DefaultCont...

how can I get around no arrays as class constants in php?

I have a class with a static method. There is an array to check that a string argument passed is a member of a set. But, with the static method, I can't reference the class property in an uninstantiated class, nor can I have an array as a class constant. I suppose I could hard code the array in the static method, but then if I need to c...

is it possible to create a search engine to index new jobs from many company websites?

I dont think it's possible without some xml/api given by the employer websites? basically can i extract and identify information from a html page? ...

Calling a method with an array value in PHP

I have a class like this class someclass{ public function somemethod(){} } Now I have an array: $somearray['someclass'] = new someclass(); $somearray['somemethod'] = 'somemethod'; How can I fire them, I tried the following: $somearray['someclass']->$somearray['somemethod'](); usign this I get the following error: Fatal er...

how to create a dynamic link panel in wordpress

i am very new to wordpress. I have a div for links and I want to be able to add links to that div from the wordpress admin panel. How should I do it? ...

Drop into read-eval-print loop from PHP code?

Is there a way to drop into a read-eval-print loop from inside PHP code during execution, in a script that was run from the command line? That is, like php -a or phpsh? Or do I have to re-implement a REPL from scratch? I can't find any way to do it. To clarify: the reason why I need to do this is that I want to automatically include all...

Passing Flash variables to PHP.

Hi, I have a simple standalone application written in Visual Basic that I'm porting to a browser based application using PHP/javascript. The original VB application has some simple embedded flash games with token and point counters. The token and point values are being passed as variables between the application and the game. I'm tryi...

PHP: filter string to work as a function name

what is a quick way to filter a string to work as a function name? note: I'm thinking something like filter_var(). ...

PHP with Javascript: Email confirmation script not working

Hey Heres what i got: echo "<script type=\"text/javascript\"> function finishForm() { var answer = confirm('Are you sure these are the teams you want to enter with?'); if (answer) { if(document.getElementByID(emailconfirm).value == ".$_SESSION[Email].") { form.action=\"esubmit.php\"; form.submit(); ...

Problem inserting JavaScript into a CKEditor Instance running inside a jQuery-UI Dialog Box

Hello Overflowers! Here's what's going on: I'm building an app (using PHP, jQuery, etc), part of which lets users edit various bits of a web page (Header, Footer, Main Content, Sidebar) using CKEditor. It's set up so that each editable bit has an "Edit Content" button in the upper right that, on click, launches an instance of CKEditor...

magento XML RPC problem Class 'Zend_Http_Client' not found in...

Hi, Any idea on what would make this happen? Im trying to use XML RPC zend version but anytime I try to include the client I get some sort of error. Its like its including the client, but then the client does not know how to include the files after that... test connect script is located in root directory, with the following - require_...