I'm trying to use Live Search 2.0 but even a simple example doesn't seem to work. Microsoft only has example code for 1.1 and they're not giving out AppIDs for that version.
Here's what I'm trying with:
<?php
$server = new SoapClient('http://soap.search.msn.com/webservices.asmx?wsdl');
class Search {
public $Request;
}
class Sear...
The goal is to take the current working directory split it at /clients/ and see if the user is in
[something]/clients/[their username]/[something]
for example, the goal would be for input:
cwd = "/volumes/raid0/www/clients/mikey/test_folder/"
$session->username = "mikey"
to return with
$authorized = true
I would like this to rec...
Hi,
I have a page generated by php which includes two drop-down lists (SELECTs) which contain a lot of items (about 2,000 each). The page is fine, but when it loads in Firefox, there's a delay during the load, and then it seems to refresh the entire page. If a user tries to click on anything before the "reload" occurs, it has no effect....
I'm a big fan of Yahoo's recommendations for speeding up websites. One of the recommendations is to combine images where possible to cut down on size and the number of requests. However, I've noticed that while it can be easy to use CSS sprites for layouts, other image uses aren't as easily combined. The primary example I'm thinking of i...
I work on a database driven website. Most pages' titles are the names of partners we have, and served from a database using php.
For example one page might be called "Experian". The problem is that some of the values for partner names don't work because the values are things like
$partnername22 = Discover<sup>tm</sup> Magazine
I...
I'm in the process of moving an application from PHP to Java and there is heavy use of regular expressions in the code. I've run across something in PHP that doesn't seem to have a java equivalent:
preg_replace_callback()
For every match in the regex, it calls a function that is passed the match text as a parameter. As an example us...
PHP doesn't get much love but is still a winner at easy deployment (for cheap hosting).
Are there any programming languages (besides haXe) that target PHP? Writing applications in this language and then translating it into PHP, like some languages target C as an intermediate language?
The Scheme implementation Chicken compiles into C....
I am a bit of a newbie to Reg Ex and don't fully understand the difference between the different flavors. However, I have a basic Reg Ex that works when I try it via the UNIX system (vi and grep) but not when I try to to use it in PHP's ereg functions. I suspect there is something different about the PHP ereg function that is making this...
Hi guys!
I want to do something like this:
page A has a link to page B
page B gets content from a database and processes it
the result from page B is displayed on a div in page A
please notice that I don't want to leave page A while page B processes the information of the database.
what I'm really trying to do is avoid using fra...
I use ftp_put / ftp_nb_put to upload files from my PHP server to another machine. I am frequently (90% of the time) getting absurd error messages like:
Warning: ftp_nb_put(): 2 matches total
Warning: ftp_nb_put(): Transfer complete
Warning: ftp_nb_continue(): Opening BINARY mode data connection
Now errors like "no such directory" or ...
I'm writing some routes for a REST service. One of my resource's URI looks like this
resources/user/:id
I also want to give access to individual attributes of a user, which would look like this
resources/user/:id/:attribute
But when I try to define that latter route, it doesn't work. Here's my ini where the routes are defined
rout...
I have a class that extends Zend_Form like this (simplified):
class Core_Form extends Zend_Form
{
protected static $_elementDecorators = array(
'ViewHelper',
'Errors',
array('Label'),
array('HtmlTag', array('tag' => 'li')),
);
public function loadDefaultDecorators()
{
$this->set...
Hi There,
I have an account on WHM for a PHP web app that's over 50GB in size on a dedicated server, the company decided to move it to a new server, and I was assigned the task.
I would like to know what is the best way to do it, built-in WHM copy account function, or creating full backup and restore it to the new server?
Thanks in ad...
In the application I'm writing using a combination of development environments and languages, I have need of accessing a cookie from two different subdomains, each on a separate host.
The cookie is being set on www.mydomain.com using the PHP code that follows, and I'm attempting to access it from distant.mydomain.com on a separate host....
Hi Stackers
I have a class named Page with a private property currently called _pageData which stores all the information (such as title, content, keywords etc).
However, this to me doesn't look so good when I refer to it $this->_pageData. I want to think of a better name, and I'd imagine there would probably be a standard or 'best pr...
I'm just wondering if there is a quick way to echo undefined variables without getting a warning? (I can change error reporting level but I don't want to.) The smallest I have so far is:
isset($variable)?$variable:''
I dislike this for a few reasons:
It's a bit "wordy" and complex
$variable is repeated
The echoing of a blank string a...
What are the benefits of PHP's CLI over other scripting languages/environments such as VBScript or even windows scripting?
...
I'm having trouble capturing this data:
<tr>
<td><span class="bodytext"><b>Contact:</b><b></b></span><span style='font-size:10.0pt;font-family:Verdana;
mso-bidi-font-family:Arial'><b> </b>
<span class="bodytext">John Doe</span>
</span></td>
</tr>
...
The Zend Framework based site I have been working on is now being migrated to its production server. This server turns out to be nginx (surprise!). Naturally the site does not work correctly as it was developed on Apache and relies on an htaccess file.
My question is... anyone have any experience with this? Any ideas on how to translat...
Hello,
I'm writing a PHP application with testability in mind, so my classes always ask in their constructors for the "collaborator objects" they depend on, in respect to the Dependency Injection pattern.
That way, I'm able to pass in mocks or test implementations in my unit tests.
What I want to achieve though, is to be able to insta...