I am using Zend Framework, and to illustrate what is working I added the saveAction() to this post and it works flawlessly. It will animate and change the class as I want. The function upload instead only change the text and ignore the javascript. I can do alerts that works, however jquery is not possible. I get error saying that $ is un...
In this question the OP mentions PHP throwing a 500 error automatically when error_reporting is off, and XDebug changing that behaviour.
That got me curious, as I've never heard of PHP automatically emitting 500s before. According to various quotes and answers on SO and elsewhere, it seems to indeed be PHP's default behaviour to throw a...
Hey,
I have used this php to fetch my blog's latest post:
function read_rss($display=0,$url='') {
$doc = new DOMDocument();
$doc->load($url);
$itemArr = array();
foreach ($doc->getElementsByTagName('item') as $node) {
if ($display == 0) {
break;
}
$itemRSS = array (
'tit...
I want to replace word groups by links.
The word groups are defined in a multi-dimensional array. There will be thousands of terms to be replaced, so an unindexed, light-weight and multi-dimensional array is needed.
Nothing should be replaced when the term is followed by brackets or inside square brackets.
Problem:
The regex itself w...
How to call function of just created object without temporary variable?
Code
(new \Foo())->woof();
is not valid in php.
What is right?
...
I would like some help on how to do this task (PHP and Dojo)
Currently I have 2 dojo radio buttion and a dojo combobox. When the user click on a radio button I would like to do the followng:
1: Execute a JS/dojo function
call a php method that return a json object
populate the combobox with the new context
and select ...
So I am getting started with OO PHP, and after reviewing a variety of classes which I have downloaded from the internet, I have noticed that some - but not all of these classes have an intial function with the same name e.g.
class MyClass{
function MyClass{
//function contents in here
}
function otherfunction{
//more stuff here
}
...
Does anyone know how I can take a mysql datetime stamp, such as YYYY-MM-DD HH:MM:SS and either parse it or convert it to work in JavaScript's Date() function, such as.. Date('YYYY, MM, DD, HH, MM, SS);
Thank you!
...
I have a little problem.
When I click send on my contact form I get the following warning:
Warning: mail() [function.mail]:
Failed to connect to mailserver at "localhost" port 25,
verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
I use 64bit Win7, but I have no idea what should I set up to make this work.
...
I have point A(x,y) and B(x,y). they listed as array (a => array(x,y), b => array(x,y))
How get lenght between point A and B. Please help in php. :)
...
This function grabs all the jpegs from folders which match the page name and prints a background image. On the homepage it searches all the sub directories and chooses one at random. What i would like is to exclude (on the homepage only) certain files which match an array of names...can anyone help?
$isHome = $this->level() == 0;
$pa...
ie, verify
$a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1;
but not
$a[0]=1; $a[0]=2; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1; $a[0]=1;
thanks :)
...
I have a PHP script which calls methods from a class I have written. However due to the nature of the system there are occasions where the method called does not exist e.g
$snippets = new Snippets();
echo $snippets->fakeMethod();
in the above example fakeMethod() does not exist and the script fails with a fatal error and stops altoge...
Hi, I have a record returned from MySQL that has a datetime field. What I want to do is take this value and see if it is older then 24 hours, I presume using PHP's time() to get the current time.
At the moment if I echo them out I get:
1276954824 this is php's time()
2010-06-19 09:39:23 this is the MySQL datetime
I pre...
i need to create a transparent image, then combine transparent pngs to it whilst maintaining image quality.
how can i do this?
imagecreatetruecolor(...);
//processing using imagecopymerge(..);
imagepng(...);
outputs a black background.
thanks :)
here's my actual code for reference...
$d = getimagesize(TMP.$this->files[0]);...
Do we need to use quotes in $to and in from/cc/bcc mail headers when using PHP mail function?
I mean, let's say I want to send mail to:
User One <[email protected]>
Do I have to call:
mail("\"User One\" <[email protected]>", ...
OR
mail("User One <[email protected]>", ...
I suppoose once you give me an answer for the $to, it is going...
How long can a MySQL transaction last until it times out? I'm asking because I'm planning to code an payment process for my e-commerce project somewhere along the lines of this (PHP/MySQL psuedo-code):
START TRANSACTION;
SELECT...WHERE id IN (1,2,3) AND available = 1 FOR UPDATE; //lock rows where "available" is true
//Do payment proce...
Hi,
I am having some trouble deleting documents from Solr index. I use following code:
try{
$solr->deleteById('1');
$solr->commit();
$solr->optimize();
}catch (Exception $e){
echo $e->getMessage();
}
This code sometimes succeeds, but most of the time the following exception message is retur...
Hi
I have managed to get Fiddler monitoring my localhost traffic by specifying my machine name. I am using IIS7 (localhost) on Vista business. I'm developing using PHP and am currently using the Zend GData framework to communicate with Google Calendar.
I am not seeing any communication between the IIS/Localhost server and the Google se...
Consider the following code
<?php
$username = "root";
$password = "";
$host = "localhost";
$database = "binaries";
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$id = 5;
if(!isset($id) || e...