Hi,
I am working on this PHP function. The idea is to wrap certain words occuring in a string into certain tags (both, words and tags, given in an array). It works OK!, but when those words occur into a linked text or its 'src' attribute, then of course the link is broken and stuffed with tags, or tags that should not be inside a link ar...
I've got a Java REST based web service sitting on a server which is accessed via a PHP web application on a separate server.
The PHP app delegates the actions performed by browser clients to the web service. I want to perform a file upload function to the web service via HTTP POST and PUT. The browser clients will use POST to upload a f...
Isn't PHP suppose to show an error is you call a non-existent CONSTANT? When I run the code below for a constant that is not defined, it shows on the screen "TEST" instead of any kind of error. Could I have a setting wrong in my php.ini file or is this something new? Im running PHP 5.3
<?php
echo TEST;
?>
...
I have a multidimensional array called $songs, which outputs the following:
Array
(
[0] => Array
(
[Michael Jackson] => Thriller
)
[1] => Array
(
[Michael Jackson] => Rock With You
)
[2] => Array
(
[Teddy Pendergrass] => Love TKO
)
[3]...
Guess the title says it al, somehow my xslt transformation with php always adds xmlns="" as an attribute to all root elements. Is there a way to prevent this?
...
Basically, I want to upload about 10,000 family photos that have been organized into folders according to names of the people involved. What I'm looking for is php driven software that allows me to put passwords on each of the folders initially and then allow the family members themselves to manage their folder by adding additional usern...
I've developed a user rating system that takes analyzes a users and saves their information with a score in a db.
I'm getting close to 1 Million users rated and stored.
I'm having issues with taking a certain set of users from the table (score < 50) and then comparing their ids against another set of ids without the whole thing crashi...
Client wants graphical representation of users online, registrations/logins/logouts graphics etc. Is RRDtool ok for it?
...
Hello,
I have a question concerning the design of my project's Code.
In most cases, it is important to separate content from code (HTML mixed with PHP in bigger apps=No good idea, etc.) but how should I handle things like the text of error messages?
Assuming this one message will be only used in one case/PHP file:
MessageBox( 'Somethi...
What are some code examples that I can use to stop people from casting votes to give them a higher rating by hacking the php script?
...
I'm doing some broad performance investigation in an application I maintain and I've set up a simple solution to track the execution time of requests, but I'm unable to find information to verify if this is going to be satisfyingly accurate.
This appears to have netted some good information and I've already eliminated some performance i...
Hello everyone,
I'm currently working on the server side of an augmented reality project. It's a lot like http://www.livingsasquatch.com/. I'm using PHP/MySQL and FFmpeg to capture the webcam video and encoding it to .flv.
Basically Flash uploads the video as a long series of .jpg images. PHP then takes those images, generates a few th...
I'm new to the PHP SimpleTest framework, and I was surprised to see that a failed assertion doesn't halt the test method. In other words, this causes two failure messages in the test report:
function testFoo() {
$this->assertTrue(true, 'first: %s');
$this->assertTrue(false, 'second: %s');
$this->assertTrue(false, 'third: %s'...
I've got a string like "foo\nbar", but depending on platform, that could become "foo\n\rbar", or whatever. I want to replace new lines with ", ". Is there a nice (php) regex that'll do that for me?
...
Here is my code, greatly truncated.
<?php
session_start();
header("Content-Type: application/msword");
header('Content-Disposition: attachment; filename="Contrat d\'étude.doc"');
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<p align="right"...
I have an array of fields (not rows!) I want to loop through, in a table, in a predefined order, backwards (alternatively, I could reverse the order of the array) and return the field name of the first field that returns a predefined value.
For example, the fields are like this:
field_a => 1
field_b => 0
field_c => 1
field_d => 0
field...
We having been using multiple webservers for our cakephp application,
now the problem is there are two cache directories , server 2 is clearing his cache before doing any insertion in his database. BUT server 1 doesn't know the about the database has been changed , so server 1 cached is not cleared
When new web request comes to serv...
Hello,
I was wondering where I would be able to get a good cPanel reseller hosted in the UK at a sensible price. I am currently hosted by ResellerZoom in the US but I find the speeds very poor and so am hoping to move.
Does anyone know anyone good at a low price which takes Paypal, or is a reasonably well known host? I don't need much ...
I am looking at ways to tie together a number of Windows-based web services together under single-sign-on. Microsoft's Windows Identity Framework and ADFS 2.0 are the perfect tools for the job, except that not all of our web services are written in .NET. One is classic ASP and another PHP. Are there existing libraries that will work for ...
Help me figure out why isn't my form getting styled a la sites/all/modules/pecapture/themes/pecapture-displayform.tpl.php
Here's my code:
/**
* Implementation of hook_theme()
*/
function pecapture_theme() {
$path = drupal_get_path('module', 'pecapture') . '/theme';
return array(
'pecapture_displayform' => array(
'argume...