Hi everyone,
I am sure I could somehow figure this out but it's just taking me way too long since I am not a PHP guy. Hopefully someone can set up the script for me in minutes...
So here's what I need to do:
I transmit 2 pictures from a smartphone to a webserver. These 2 images need to be merged (watermarked). They differ a little:
p...
I'm using constants to set various configuration variables within a script.
The INC_PATH constant is defined within the script that includes the class library.
define('INC_PATH',$_SERVER['DOCUMENT_ROOT'].'includes/');
include('class.lib.php');
The class library contains various include('someClass.php') lines. It also contains:
requ...
To escape the string to be used as shell argument we use the function escapeshellarg() in PHP. Does Perl have an equivalent function ?
...
API documentation in Digg is totally confusing...does any one know how to count submissions for a particular URL in PHP??
some API paths that will return in XML or Json will do...
...
I am new to workflow engine how it work and how I can develop it; I have A LMS (Learning management Service) site. I need to have a dynamic workflow. Can you please sugest me how I can develop it.
...
Hello,
I've added an image attribute with name and label e.g. New Image, new_image.
How do I fetch this from e.g. view.phtml? I thought it would be as simple as
helper('catalog/image')->init($_product, 'new_image')->resize(150, 150); ?>
But, this is throwing an error.
Does anybody know the correct way to do this?
Many thanks.
...
Hi, here's a six core with 32GB ram. I've nginx 0.7.X and php5-fpm with php5.3 (from dotdeb.org). Important config files:
nginx.conf
user www-data;
worker_processes 2;
events {
worker_connections 4096;
}
location ~ \.php$ {
fastcgi_pass unix:/tmp/fcgi.sock;
fastcgi_index index.php;
...
Hi,
I have a site where people can submit links to sites about iPhone apps. The guy submits the application name, description, category and URL. This site has years and never received any constructive submission from a russian developer but, unfortunately it was discovered by russian spammers that annoys the hell out of me. Even with a...
I know how to do X amount of leading zeros, and I know how to do X amount of decimal points. But, how do I do them both?
I am looking to have 4 leading zeros to a decimal precision of 2: 0000.00.
Therefore 43.4 would be 0043.40
...
Hi all,
I am looking for means to highlight certain text on a page. I use <span class="highlight">This is a sample</span> to replace the text "This is a sample" that is found, with the help of the preg_replace function.
My problem arises when there is overlapping text. If I search for the phrase "sample text" on the same page, it is no...
So I have this in my index.php:
Zend_Session::start();
Then in one of my controllers in the init method I do:
if (false === isset($this->defaultNamespace->tree)) {
$this->defaultNamespace->tree = array();
}
Which still works. But then in action in the same controller I write this:
unset($this->defaultNamespace->tree); // I tri...
hello,
i have found lots of website running PHP which the post count from some hundreds back to 0.
for example, a user with some hundreds of post count posting a forum topic.
the loads is very slow ... and when it posted successfully, that user post count become 0.
i know this is because not enough memory for PHP.
all my website run...
Hi guys, I am trying to use AMF PHP to pass variables to a flash file, thus far I cannot see anything wrong with my code, but I have very little experience with creating classes, so here it goes, here is my code,
index.php:
<?php
include "amfphp/services/flashMe.php";
$session = true;
if ($session == true) {
$uid = '12345';
$thi...
Hi everybody! I'm new to php and have zero exprience with the cake-php. I created the php web services, which reads data from MySql and return to my iphone app. Previously I used the same code successfully in many app, But now I'm facing the problems in it. Because the web server on which I installed my web services is cake-php based. wh...
So, I've got a little problem with my Unittests. I wrote some basisclasses for different Testcases and I want to uses some prepared test-methods.
i.e.
class ModelTestCase extends PHPUnit_Framework_TestCase {
public function testCreateInstance() { ... }
}
class UserModelTest extends ModelTestCase {
/**
* (at)depends testCreateIn...
I have the same question with graphviz that you had: http://stackoverflow.com/questions/1721395/warning-in-image-graphviz
Can you please share where to configure the tmp folder?
Appreciated,
Tiago Carvalho
...
I wrote a script to parse some data from a website using cURL and it works fine when I run it in my browser, however when I want to run it in the command line I get the error "call to undefined function curl_init()". Do php scripts run under different settings from the command line?
...
I need a function or some regex to split up spaces in a string but to treat an HTML tag as a word.
$str = 'one two <a href="">three</a> four';
$x = explode(" ", $str);
print_r($x);
/* Returns:
Array
(
[0] => one
[1] => two
[2] => <a
[3] => href="">three</a>
[4] => four
)
Looking for way to return:
Array
(
[0...
From this code:
$toolbox = RedBean_Setup::kickstartDev("mysql:*****************");
$r = $toolbox->getRedBean();
$test = $r->dispense("test");
$test->nom = 'Test #1';
$test->date = '2010-07-08';
$test->date_deux = '08/07/2010';
$test->num = 5;
$id = $r->store( $test );
I get this SQL:
CREATE TABLE IF NOT EXISTS `test` (
`id` int...
Hey guys, question about regex in PHP!
For the given pattern, kinda like a shell terminal syntax:
application>function -arg1 value -arg2 value -arg3 value -arg4 value
I want to parse the arguments. This is my regex code
$command=' -arg1 value -arg2 value -arg3 value -arg4 value ';
// note the string begins by a space character and ...