php

PHP Date dropdown list

Below is an old PHP function I have for a dropdown list for users to select there birthdate, this is just the day date portion of it, you can see that it uses str_pad to add on a 0 to the numbers 1-9, is there a better way of doing this? <?PHP $date_combo .= '<select name="' . $pre . 'day" class="' .$style. '">'; $date_combo .= "<option...

Immitate PHP 5.3 DateTime in PHP 5.2

Hello, I was playing with the DateTime object in PHP 5.3 on my local machine and made something useful but my host (NFS) is only running 5.2 and doesn't plan to upgrade until 5.3.1 is out. So my question is, is this code possible using 5.2? Specifically, DateTime::getTimestamp doesn't exist in 5.2 The nicetime.php include is similar t...

Creating a distribution list outside of outlook in php

I am trying to create an outlook distribution list with php but I am having a hard time finding any resources or instructions on how to do so. Is it even possible to do this? ...

How do I extract a date range from a csv using perl/php/grep/etc?

Is there a way to take text like below (if it was already in an array or a file) and have it strip the lines with a specified date range? For instance if i wanted every line from 2009-09-04 until 2009-09-09 to be pulled out (maybe this can be done with grep?) how would I go about doing so? date,test,time,avail 2009-09-01,JS,0.119,99....

PHP - How do I get the class name or filename of the object that instianiated the current object?

To clarify: I'm building a Logger class that allows me to easily log messages: lib.Logger.php: <?php class Logger { private $handle; public function __construct($log_name, $log_path) { if ( ! is_dir($log_path)) throw new Exception('Log path does not exist.'); if ( ! in_array(strtolower(substr($lo...

Yet another question of my googlemaps problem.

I have asked in two earlier questions to place multiple markers from a XML file created from Lightroom, which had to be tranformed in degrees instead of Degrees,Minutes,Seconds. This part i managed but then... The answers in the previous question were very informative but it's my poor skill of programming (first project) that i just can...

prepared-statement pass by reference error

I'm not seeing the error and was hoping someone could figure it out: public static function createMessage($title, $message, $startDate, $endDate, $author, $status){ //$dbConn is now a mysqli instance with a connection to the database foobar $dbConn = Database::getConnection("foobar"); $stmt = $dbConn->prepare("INSERT...

php project deployment new problem

i have done one php project and i have uploaded it on server.I had devlopveped it on windowas and now i am trying to deploy it on remote linux server. But i am geting error. Some parts of page are not shown i donr know why? For example i have one page appply as follows . i can see only top part other parts i cant see. <?php require 'i...

Command line html formatter that works on linux (or a way to do this in PHP)?

Does anyone know of a linux-compatible command line html formatter? You know, something where I could pass it a file that looks like: <html> <body> <p> hi </p> </body> </html> And it gives me: <html> <body> <p> hi </p> </body> </html> I'm using PHP to generate this html, so if there is some handy...

PHP Curl, retrieving Server IP Address

I'm using PHP CURL to send a request to a server. What do I need to do so the response from server will include that server's IP address? ...

PHP - Check to see if a string is serialized?

What's the best way to determine whether or not a string is the result / output of the serialize() function? ...

How to limit characters per message and make anti-spam?

Hi, i have this shouwbox script. I would like to know how to limit the characters for each message like 70 characters. And i would also like to know how to do so you have to wait 3 seconds between each message you post. Here is my script. Index.html <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-...

Does PHP compile data?

I'm a student learning PHP. I basically make the stuff work, but never wondered about how the php.exe(on windows) works. Does it compile the stuff it has to handle or not? Reason I'm asking is because someone told me that ASP.NET has to compile all website-dependant data is has/receives, like everything that gets uploaded through a for...

User reporting Library

I would like to build (or find) a php reporting library that I can use to allow my users to report any type of content as bad. Actually, if they could report content as good (which I guess would mean a rating system) that would be even better. So if anyone knows of a library like this I would love to hear about it. Anyway, this is how I...

Regex for http-equiv="refresh" meta tag

Hey, I need a regexp in PHP to find a the http-equiv="refresh" meta tag in a URL. What I need is the actual URL to follow. Now, as far as I know there are two valid ways to use this meta tag: content="0; url=urlhere" http-equiv="refresh" /> and http-equiv="refresh" content="0; url=urlhere"/> Thanks! ...

what issues are there with upgrading Zend Framework to 1.9.1 from 1.7.6

Hi, I'm working on a project that is currently using the Zend Framework 1.7.6, however the current release of the framework 1.9.1 has some features that would really make my life a little easier, so I want to update the framework. As this is quite a jump I know that it is going to break parts of my application. Items such as the boots...

Zend_Navigation caching

Hi I'm having trouble with the page hierarchy of Zend_Navigation getting scrambled when I cache it using Zend_Cache. Background: I have approx 50 pages and approx 300 products stored in a database. I query the database and create an array to feed to Zend_Navigation. The cache is $secondsBetweenRefreshes = APPLICATION_ENV == '...

Problem Setting Cookie w/ PHP

I'm working locally across two "domains". I have enterprise.local and application.local virtual hosts on my machine and I need to set a domain cookie for "local" or ".local" I'm having some trouble getting the cookie to set properly, though. In application.local, I have this: setcookie( 'iPlanetDirectoryPro', trim( $token_id ), '0', '/'...

Multiple conditions in PHP

I know this is embarrassing easy but I cannot get this to work right now, keep getting syntax errors, I just added in a jquery code that pre-fills in a form filed and when you select the form field it will clear the default value. The result though is if a user submits the form without changing the default value, I need to see if it exi...

how to pass by reference a class var to a global var in PHP?

Hi guys, please tell me theres a way around this... $my_var = 'hello'; class Test{ private $my_var; private $my_internal_var = 'if you see this it works!'; function __construct(){ global $my_var; $this->my_var = &$my_var; } function get_my_var(){ return $this->my_var; } function...