Hi,
i'm trying to play with php5.3 and closure.
I see here (Listing 7. Closure inside an object : http://www.ibm.com/developerworks/opensource/library/os-php-5.3new2/index.html) that it's possible to use $this in the callback function, but it's not. So I try to give $this as use variable :
$self = $this;
$foo = function() use($self) {...
My questions are:
How can I know if the AJAX is working properly?.
How can I retrieve the sent data in the controller in CakePHP?
My code is:
function checkLength(obj,url){
alert("URL="+url+" OBJ="+obj);
if(obj)
{
var params = 'query='+obj;
var myAjax = new Ajax.Request(url,{method: 'post',parameters...
I have this problem with the script:
Notice: Undefined index: show_times in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 192
Notice: Undefined index: hours_24 in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 194
Notice: Undefined index: start_monday in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 19...
I used this code to connect to a database and fetch results. This worked perfectly until i tried to work in another query to the images table to get associated images. I'm not very experienced with OO programming. So hopefully someone can see where ive gone wrong and help me out.
<?php
global $__CMS_CONN__;
$sql = "SELECT...
I have a class implementing ArrayAccess and I'm trying to get it to work with a multidimensional array. exists and get work. set and unset are giving me a problem though.
class ArrayTest implements ArrayAccess {
private $_arr = array(
'test' => array(
'bar' => 1,
'baz' => 2
)
);
publi...
Hello,
Hopefully this is the right place for this question.
I have done a fair amount of research and yet to find anything that matches what I want. What I'm envisioning is the following. Let me know if any of you know of a program that will do what I want.
Also it must be web-based
anom user -> fills out form ->
email gets sent to admi...
I am creating a BlackBerry client and a PHP web service.
1) I want to send "hello world" from the BlackBerry to the php service. The service will respond with "hello world"
2) The BlackBerry will take that "hello world" from the php service and display it to the user.
...
in symfony 2.0 and django there are bundles that contain everything for a feature (html, css, js, img, php/python).
so if you want to delete one feature, you basically just delete that bundle and unregister it from "main".
are there java frameworks for this too? or is it different in java cause java is a compiling language.
thanks
...
I use this class for sending e-mail:
http://www.phpguru.org/downloads/Rmail/Rmail%20for%20PHP/docs.html
It was working until I switched from "mail" to SMTP.
Now, if I use setHtml($html) it works, but if I also use setText($text), it doesn't work.
Can it be that $text contains some invalid characters?
Why would those characters work w...
I am doing a query with three tables, the problem was one table has many occurrences of id of another.
sample data:
users: id
answers:
id:1
user_answer :1
id:1
user_answer :2
id:1
user_answer :3
Questions:
id:1
answers :answer description
id:2
answers :answer description
id:3
answers :answer description
How can I get all user inf...
I have this two arrays:
$arr1=array( array("id" => 8, "name" => "test1"),
array("id" => 4, "name" => "test2"),
array("id" => 3, "name" => "test3")
);
$arr2=array( array("id" => 3),
array("id" => 4)
);
How can i "extract" arrays from $arr1, where id have same val...
Hi everyone,
I programmed a CMS that has a log of who has recently logged into the system. Presently, this data is fed into a jQuery UI tab via Ajax. I would like to put this information into a sidebar on the main page and load it via AJAX every 30 seconds (or some set period of time).
How would I go about doing this? Does the PHP resp...
Hi,
What I want to do:
Create a number of modules with the forms folder inside them.
What I did:
Create a bootstrapper inside the module and added an _initAutoload function with the specific module name as namespace.
For instance, an admin module with the following bootstrapper:
class Admin_Bootstrap extends Zend_Application_Mod...
Can someone please help me simpling this redundant piece of code?
if (isset($to) === true)
{
if (is_string($to) === true)
{
$to = explode(',', $to);
}
$to = array_filter(filter_var_array(preg_replace('~[<>]|%0[ab]|[[:cntrl:]]~i', '', $to), FILTER_VALIDATE_EMAIL));
}
if (isset($cc) === true)
{
if (is_string(...
how to use word Net with php is there is any interface or any class for it.....
i need to use wordnet for my dictionary purpose....
...
I installed the Mail_Mime package.
include('Mail.php');
include('Mail/mime.php');
I get the following errors:
Warning: include(Mail.php) [function.include]: failed to open stream: No such file or directory in /var/www/vhosts/domain.co.uk/httpdocs/mail_mime/index.php on line 2
Warning: include() [function.include]: Failed opening 'M...
I have a nested array (only one level deep) like this:
$a = array(
array( 1, 2, 3 ),
array( 2, 4, 6 ),
array( 5, 10, 15 )
);
And I'd like a nice way to implode() it to this form:
1,2,3|2,4,6|5,10,15
I can run a loop to implode(',',...) each array in $a (storing those strings in a temp), and then implode('|',...) that tempor...
Hi,
I have a pdf file on disk that i need to send to a user when they make a request to a php script, what is the best way of doing this?
Thanks
...
I would like to take a database of say, 1000 users and select 20 random ones (ORDER BY rand(),LIMIT 20) then order the resulting set by the names. I came up with the following query which is not working like I hoped.
SELECT * FROM users WHERE 1 ORDER BY rand(), name ASC LIMIT 20
...
Is there a Windows equivalent of ncurses for PHP?
I've created a CLI script and want to display various statistics (currently processed record, completion percentage etc.) in a nice way, without outputting loads and heaps of text to the cmd.exe window.
The ncurses extension doesn't work on Windows.
...