Is there any way by which we can find Date Format as set in the computer where web pages are loading?
I want to show date in my web pages according to what is set in client machine system.
I have seem an ASP based web page which lists all the system setting of a clients system including information of drivers installed!
So if it is po...
I'm developing a application with CakePHP, and I have two layouts: one for the home page, and another for the rest of the application. Except for some coding on the header, they're almost exactly the same. Is there something I can do to keep DRY, without using IFs all over the layout?
...
I'd like to find the date after a date provided by the user
This is not working:
$start_date = '2009-06-10';
$next_day = date( $start_date, strtotime('+1 day') );
echo $next_day; // 2009-06-10
...
First off, this isn't exactly the ideal way of setting up a page, however there's a need to distribute a script as 1 file.
I have a php script at the top of an otherwise xhtml document with javascript, and under certain conditions use XHR to send a query string to the page itself. The php at the top then activates, and stores the passe...
Say, I have "index.htm" and "routines.php".
"index.htm" will call eventually call "routines.php" using JS (AJAX).
So, my question is, how can "routines.php" verify that the request came from the same local server and not outside? Is there a global variable I can check at PHP level or HTTP level?
Edit 1: Using AJAX
...
I have a PHP script running that lists files in a certain directory on the server. Is there any way to access the file's icon metadata? Lots of issues with this I suppose (eg: depends on the OS hosting the script. depends on whether the file is using a custom icon. still have to convert the icn file to something that can be displayed in ...
Hey all, just a quick question (should be an easy fix I think). In a WHERE statement in a query, is there a way to have multiple columns contained inside? Here is my code:
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and pwd='$pass'";
What I want to do is add another column after the WHERE (called priv_level = '$privle...
Before I write my own function to do it, is there any built-in function, or simple one-liner to convert:
Array
(
[0] => pg_response_type=D
[1] => pg_response_code=U51
[2] => pg_response_description=MERCHANT STATUS
[3] => pg_trace_number=477DD76B-B608-4318-882A-67C051A636A6
)
Into:
Array
(
[pg_response_type] => D
...
I commonly run into a scenario where "the powers that be" want an exact copy of a page in multiple places on a website. Rather than actually duplicate the content, all I do is override the section in the nav that is highlighted, and then include the page. The final page looks something like this:
<?php
$top_nav_item_id = 'teen';
...
I was wondering if it's considered a bad practice to globally convert all PHP Errors to Exceptions. Something like the following would be used:
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
return false;
}
I suppose the assumption is ...
If you have a $start_date and $end_date, how can you check if a date given by the user falls within that range?
e.g.
$start_date = '2009-06-17';
$end_date = '2009-09-05';
$date_from_user = '2009-08-28';
At the moment the dates are strings, would it help to convert them to timestamp integers?
...
In our application, the backend is accessed via Zend_XmlRpc. In the backend, I'm using Zend_Http_Client together with Zend_Http_Client_Adapter_Curl to connect to another web service over HTTPS.
During unit tests, everything works as expected and the remote service is accessible. But when the frontend connects via Zend_XmlRpc to the back...
My web app allows users to upload a bunch of photos simultaneously to the server, and then stores them in a database. When the first photo finishes uploading, it should create a default album based on today's date, and add it to that. But what if photo1 completes, looks for the album, and can't find it so it decides to create it, but bef...
CREATE TABLE `comments` (
`comment_id` int(11) NOT NULL AUTO_INCREMENT,
`comment_parent_id` int(11) NOT NULL DEFAULT '0',
`user_id` int(11) NOT NULL DEFAULT '0',
`comment_text` varchar(200) NOT NULL DEFAULT '',
`comment_created` int(20) NOT NULL DEFAULT '0',
`comment_updated` int(20) NOT NULL DEFAULT '0',
`comment_replies_c...
Hi
I'm setting up a registration page, and I'm using PHP primarily to verify the data.
I've realized that using a client-driven language for some of the validation will reduce the workload from the server.
I don't have much knowledge in jquery, but I'm looking for code that will determine the correct syntax of an email (ex, one '@' and...
Hi to everyone,
i am implementing a log-in system, i am sure a lot of you know what it is, i use sessions to store the user's ID, and check it if he access a page that needs the user to be logged in.
But my problem is when the user clicks the log-out anchor, nothing happens i still can access the other pages as long as the current page i...
Hi,
I'm no php expert (a mere beginner) but need some help!
After hours searching Google and trying out about 100 different scripts, I finally found one that does what I need - almost.
Basically, my site has a button marked 'Export to Excel'. Visitor to site clicks button and a download begins containing all data from a specified tabl...
I'm using the default framework code that was created with the Zend Framework Application tool, I added some autoloader magic so that any classes named Default_<*>_<*> would automatically be loaded from the correct directory, in this case Default_Model_TableName.
application/models/ProjectCategories.php:
<?php
class Default_Model_Proj...
I host my site with GoDaddy , and I use the PHP mail() function at the moment to send form mails from my site. GoDaddy has a 1000 SMTP relay limit per day for form mail stuff, but they swear that with my PHP script that I should not be touching it.
Since mail() doesn't take SMTP info, does it just automatically use GoDaddy's (or whatev...
By default it will not print out anything until the whole page has finished executing.
Is there any function that can make it flush out right away?
But not by calling ob_end_flush() multiple times,which is not what I want.
Hope you guys got me?
...