I know that it is possible to create a function within another function. Why might one need to do that in real life? (PHP)
function someFunction($var)
{
function anotherFunction()
{
return M_PI;
}
return anotherFunction();
}
...
Hi guys, I have to create a PHP SOAP client that sends leads, but I have never worked with SOAP before, and my XML isn't that great, here is the code I have managed to write so far. . .
<?php
try {
$client = new SoapClient(null, array(
'location' => "https://wwa.website.co.za/CallmasterTes/LeadService.asmx",
...
$result= mysql_query("SELECT
cart.id cart_id,
dkb.id dkb_id,
cdkb.id cdkb_id,
dbl.id dbl_id,
cart.*,
dkb.*,
cdkb.*,
dbl.*
FROM
cart
LEFT OUTER JOIN dkb
ON ( cart.id = dkb.id
AND dkb.id = '".$ids."' )
LEFT OUTER JOIN dbl
ON ( dbl.id = dkb.id )
LEFT OUTER JO...
I have a table
CREATE TABLE `sob_tags_articles` (
`tag_id` int(11) NOT NULL,
`article_id` int(11) NOT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=112
And triing to save an object with Doctrine:
$sbTagsArticles = new SobTagsArticles();
$sbTagsArticles->article_id = $pubId;
$sb...
I'm trying to write a script which creates a number of forked child processes using the pcntl_* functions.
Basically, there is a single script which runs in a loop for about a minute, periodically polling a database to see if there is a task to be run. If there is one, it should fork and run the task in a separate process so that the pa...
The key of the associative array is dynamically generated. How do I get the "Key" of such an array?
$arr = array ('dynamic_key' => 'Value');
I am aware that It is possible to access it through a foreach loop like this:
foreach ($arr as $key => $val) echo "Key value is $key";
However, I know that this array will have only one key an...
Hi!
I am a php programmer and i have to develop a site in Japanese language using php. I know i have to use unicode for this. But did not find how to install the unicode and how to use it.
It would be great help if anyone provide me solution or the link.
Thanks in advance.
...
I'm looking for a way to prevent unauthorised users from viewing pages without, lets say, wrapping everything in an if authed { show page } else { show error}
My website is currently setup like:
index.php
require_once __WEBROOT__ . '/templates/default/header.tmpl';
require_once content('p');
require_once __WEBROOT__ . '/templates/defa...
$sql =
'INSERT INTO customer
(first_name,
last_name,
email,
password,
date_created,
dob,
gender,
customer_type)
VALUES(:first_name,
:last_name,
:email,
:password,
:date_created,
:dob,
:gender,
:customer_type)' . ' SELECT LAST_INSERT_ID()' ;
Can anyone tell me if the syntax is right? I am having problems usin...
Is it possible, with or without plugin, to add more source folders to a PHP project, just like in a Java project?
I have downloaded and tested the Java version of NetBeans, and there is clearly possible to add more source folders. But not in the PHP version?
...
I have a database which holds URL's in a table (along with other many details about the URL). I have another table which stores strings that I'm going to use to perform searches on each and every link. My database will be big, I'm expecting at least 5 million entries in the links table.
The application which communicates with the user ...
txt: text/plain
js: [application/javascript, application/x-javascript, text/javascript]
css: text/css
json: [application/json, application/x-json]
xml: [text/xml, application/xml, application/x-xml]
rdf: application/rdf+xml
atom: application/atom+xml
It is used by the framework to
automatically manage the Conte...
Hi, I have variable that in PHP controller looks like
$data['content']['mods']['HTML-FORM-END']['html']
It is passed nicely in smarty, but when I try to show it any of these ways, it shows either 0 (assumes minus as operator and does some math), or says "unrecognized tag"
{$data.content.mods.HTML-FORM-BEGIN.html}
{$data.content.mods[...
Need to restart asterisk flash operator panel (fop) from the web after configure file (op_buttons.cfg) is altered. Web server runs under daemon user. Via root user restart works.
...
I'm currently running Nginx + PHP-FPM for serving ads on OpenX. Currently my response times are horrible, even during times of low load. However, my CPU and Memory resources are fine, so I can't seem to figure out what the bottleneck is.
My current config for nginx and php-fpm is:
worker_processes 20;
worker_rlimit_nofile 50000;
error_...
Hi,
in my .htaccess file i do have these lines:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule
^([a-zA-Z0-9_-]+)/([0-9])/([a-zA-Z0-9_-]+)\.(html)$ /first_gate/index.php?show=true&_=$1&__=$2 [QSA]
So calling:
http://www.domain.com/a-b-c-d/123/an-thing-here.html
in the background it's intend...
Hi,
I want to create a images for my dynamic text.
My problem is that i am reading folder name from some specific directory.
So folder name will be what ever but client wants that folder name should come as the images only.
So i have thought that i will place one image with the same name as folder on any unique name.
but client don't wa...
Hello,
I have a session that works perfectly expect for one, if I close the browser the session gets destroyed however if I close the current tab and then go back to the site, the session still exists, how can I make sure that the session is destroyed both on a tab close and a window close?
...
I would like to access the $db['default']['dbprefix'] variable from /application/config/database.php from within a model so I can write my own queries using the value from the file.
How can this be done?
...
When I access my site on MAMP like so, it works great
localhost/site/about-us/
When I upload it to my remote server, and access it like this
http://www.server.com/site/about-us/
all requests go back to the 'default' set up in bootstrap.php.
Here is my route setting.
Route::set('default', '(<page>)')
->defaults(array(
...