I am adding a select element to a Zend_Form instance as follows:
$user = $form->createElement('select','user')->setLabel('User: ')->setRequired(true);
foreach($users as $u)
{
if($selected == $u->id)
{
$user->addMultiOption($u->id,$u->firstname.' '.$u->lastname);
//*** some way of setting a selected opt...
Hello, i have a "simple" problem with the PHP timestamp (on a linux machine).
I need to get the user birthdate in year-month-date (using 3 menus - html select). When the user is born on 1970-1-1 the timestamp is zero and the application logic gets everything wrong.
How would you deal with this case?
Regards,
...
Hi all,
here's a problem I just stumbled into:
I have an php based web service which returns statistical data about customers
in the form of WSDL-complex types. The actual complex type consists of
xsd:string
xsd:int
xsd:float
Now, since my web service is sort of an adapter to an existing system I can't
realy controll what values are...
Hey i would like do have your input on this
I use this to generate unique salts to each of my users when they register (random letters and numbers). how big is the chance that salts will colide?
uniqid(mt_rand());
I then use md5 to hash salt, password and email(in that order) together as password and rehash when they log-in.
md5($sa...
Question related to HABTM has been posted in some good numbers on stackoverflow but I am still looking for a solution to my problem.
I am creating an application that allows for creation of topics based on a particular subcategory.
While adding a topic the user is asked for tags (on the same form). Now when the user has finished adding ...
Hi,
In PHP, say that you have an associative array like this:
$pets = array(
"cats" => 1,
"dogs" => 2,
"fish" => 3
);
How would I find the key with the lowest value? Here, I'd be looking for cats.
Is there some built in PHP function that I've missed which does this? It would also be great if there was a solution that acc...
Why is PHP considered more scalable than python?
I've heard may times that one of the reasons PHP is "better" than python is that PHP is more easily scalable, and that Yahoo proves that(assumig Yahoo still uses PHP).
Whats the difference between PHP and Python when it comes to scalability?
-- edit --
well, i have no evidence, the que...
http://xcache.lighttpd.net/wiki/Faq#Iseejumpyhitsinadminpage (see section 1.10)
The Xcache jumpy situation happens when different php instances don't share memory. I simply don't know how to solve it.
I'm on dreamhost PS server. using the Xcache default installation. See server info below.
I tried the following without success:
Remov...
Is there a C# utf8_decode equivalent?
...
This must be a ridiculously stupid question, because after numerous searches of the StackOverflow question archives (and elsewhere) I can't find an answer.
I recently posted a question about managing date & time data here:
http://stackoverflow.com/questions/1587116/mysql-date-storage-query-performance-with-php
Following Mike B's advic...
Hi..
Is there any script to check the current date in PHP?
I want to use this function to display a date from mysql db, and if the date from the db is the same as todays date, then display "TODAY" instead...
Thanks...
...
The code below checks for GET params. There are two selects on the page which filter a list by type and age group.
I'm looking for a way to refactor the conditional which test the type/age combinations. Is there a more clear/concise way to write it?
if ( isset($_REQUEST['type']) || isset($_REQUEST['age']) )
{
// we need to do somethi...
Hi,
How can I allow the shell session to stay open until I close it with PHP?
In my example I want to use NcFtp to publish some files through shell command. I want to leave PHP's built in FTP because it is much much slower and performance is an issue.
It is easy to use ncftpput to publish a file or a directory. But if I want to loop t...
Hi.
why wont this work?
this is in a while loop:
$postdate = date( "j F", strtotime( $row['insert_date'] ) );
if ($postdate == date("j F")) {$postdate = "today"};
$table .= bla bla bla "$postdate";
it gives an error on the 'if statement line' in my browser...
$postdate is something like 14 october before the if statement!
Thanks
...
I'm using Netbeans to develop an HTML/PHP site and I have the Run Configuration set as follows:
Project URL: http://localhost/JEB
Project Folder: C:\Documents and Settings\John\My Documents\NetBeansProjects\JEB
Source Folder: C:\Documents and Settings\John\My Documents\NetBeansProjects\JEB
Web Root:
The "Copy files from Sources Folder...
Hi.
Is it possible to check if the date ("j-1 F-1")???
I'm a noob so some script would help! Postdate is in a format like: 14 October.
if ($postdate == date("j F")) {$postdate = "today";} THIS WORKS...
But I need to check the $postdate for the "yesterday" value as well!
Q: How to check for yesterday? that is, date()-1 somehow.
Tha...
Is there a way to close a pop-up window using PHP like the javascript function window.close()?
...
I'm running PHP5 on Windows XP Professional. I'm trying to write a telnet php script which simply connects, sends a text string and grabs the response buffer and outputs it. I'm using the telnet class file from here:
http://cvs.adfinis.ch/cvs.php/phpStreamcast/telnet.class.php
which i found in another thread.
<?php
error_reporti...
Hey Guys,
PHP manual suggests to autoload classes like
function __autoload($class_name){
require_once("some_dir/".$class_name.".php");
}
and this appoach works fine to load class FooClass saved in the file my_dir/FooClass.php like
class FooClass{
//some implementation
}
here is my question: how can I make it possible to use _...
Hi.
Is there any simple way to add a image border around an image?
Reason is I want to create a drop-shadow effect around the image.
The images are loaded as thumbnails and are 110x75 px... Im thinking about creating a shadow border, but dont know how to add this to around the image, anybody know a way?
PHP preferrably...
...