I'm playing with the flickr api and php. I want to pass some information from PHP to Javascript through Ajax. I have the following code:
json_encode($pics);
which results in the following example JSON string:
[{"id":"4363603591","title":"blue, white and red...another seattle view","date_faved":"1266379499"},{"id":"4004908219","titl...
All,
I have installed xampp for linux on ubuntu 9.10. The installation directory is /opt/lampp. The xampp website says PEAR comes with the installation.. I am relatively new to PEAR and want to know the answers for following:
Is PEAR installed with xampp or need to be installed separately using synaptic package manager? I browse to /o...
I want to generate the array $result_array. There is no error at the page, but not works!
that not works !
//BOF: Result Array
$result_array = '';
$result_array .= '"messages" => "' . $errors .'",';
$result_array .= '"this_addr_type" => "' . (int)$_REQUEST['edit'] .'",';
if (ACCOUNT_GENDER == 'true') {
$result_array .= '"gender_mal...
I have se the below date format in the codeignitor config.php
$config['log_date_format'] = 'd/m/Y';
Ans wen I enter '30/04/2010' in the text input field and tried to save, got he following error
ERROR: date/time field value out of range: "30/04/2010" HINT: Perhaps you need a different "datestyle" setting
Corresponding query is bel...
I'm using custom WordPress categories for some probably unintended functions, I will admit (things like marking a post no/index just by adding it to my custom "no-index" category, etc). But it sucks that WordPress does not enable pages with all the little extras you get with posts.
For example, while the post editor gives you convenien...
I have two Zend Date objects to work with:
$now = Zend_Date::now();
$sessionStart = new Zend_Date('2010-04-01 10:00:00', 'yyyy-MM-dd HH:mm:ss');
I need to calculate the time remaining and display in a human readable manner.
The session will begin in 7 days.
The session will begin in 30 minutes.
How can I do this with PHP and the Ze...
I am having difficulties when trying to insert files into a SQL Server database. I'll try to break this down as best as I can:
What data type should I be using to store image files (jpeg/png/gif/etc)? Right now my table is using the image data type, but I am curious if varbinary would be a better option.
How would I go about inserting ...
I'd like to accomplish what this (invalid I believe) regular expression tries to do:
<p><a>([^(<\/a>)]+?)<\/a></p>uniquestring
Essentially match anything except a closing anchor tag. Simple non-greedy doesn't help here because `uniquestring' may very well be after another distant closing anchor tag:
<p><a>text I don't <tag>want</tag>...
Here's a code example:
$array = array();
$array['master']['slave'] = "foo";
foreach ($array as $key => $value) {
foreach ($value as $key2 => $value2) {
if (preg_match('/slave/',$key2)) {
$value[$key2] = "bar";
print "$value[$key2] => $key2 => $value2\n";
}
}
}
print_r($array);
Output...
What's the most effective way to streamline WordPress theme development when moving from a dev to a production environment?
...
Hello all,
I'm currently using SWFUpload to upload files to my S3 bucket. And it's working great.
I'm using the script from a website here: http://www.anedix.com/news/article/50
Again, the upload to my S3 works fine, however, I've been running into an issue when attempting to upload larger files. It seems that I cannot upload any...
I want to send my users to different pages based on user action. So I made multiple functions at the top of the page like so:
<?php
function one() {
header("location: pagea.php");
}
function two() {
header("location: pageb.php");
}
function three() {
header("location: pagec.php");
}
?>
Of course I get an error because...
i have a database in My-sql which have entries of time there are more than 1000 entries of time . i want to extract time and run a php script exactly at that time..
i have tried to run a php script continuously which check the time but my server does not allow to run script more than 60 seconds
EDIT I have to check the db every secon...
Hi there, how can I copy two times the same file? I'm trying to do something like this:
copy($file['tmp_name'], $folder."1.jpg");
copy($file['tmp_name'], $folder."2.jpg");
copy($file['tmp_name'], $folder."3.jpg");
And how many time does temp files has before it's destroyed by the server?
I try ...
I am refurbishing a big CMS that I have been working on for quite a number of years now. The product itself is great, but some components, the Database and translation classes for example, need urgent replacing - partly self-made as far back as 2002, grown into a bit of a chaos over time, and might have trouble surviving a security audit...
Hello,
In my Drupal Site, i will be having two categories of users,say Category A and Category B. When a person wants to create an account on the site, i want to ask them which category they belong to and based on that show the fields on the User Account Form.
The fields shown depend on the category selected. The Drupal user account fo...
Is it possible to use multiple header types in one document? For example:
header("Content-type: image/jpeg");
header('Content-Type: text/html; charset=utf-8');
returns the whole page as text/html... while
header('Content-Type: text/html; charset=utf-8');
header("Content-type: image/jpeg");
Returns the whole page as an image.... Ho...
Hello,
I would like to know how can I subtract only a part of the full path:
I get the full path of the current folder:
$dbc_root = getcwd(); // That will return let's say "/home/USER/public_html/test2"
I want to select only "/public_html/test2"
How can I do it?
Thanks!
...
I'm talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so:
<?php
echo "You are $yourAge years old";
?>
But single quotes will just return You are $yourAge years old. But what about performance differences? I've always gone by the rule that single quotes are faster because t...
I'm building a PHP framework and my english is not the best.
There are several classes (database abstraction, module, router,...) in my framework and there is a place where they all have to be initialized and executed together.
What is a good name for a "master" class that initializes and runs all other classes?
...