php

How to compare two time in PHP

i had two times in the format like 7:30:00 and 22:30:00 stored in the variable $resttimefrom and $resttimeto respectively I want to check whether the current time is between this two values. I am checking this with the code $time =date("G:i:s"); if ($time >$resttimefrom and $time <$resttimeto ) { $stat="open"; ...

how we put dynamic input such as timestamp when using selenium plugin in firefox ?

i'm use selenium. i use it by using firefox plugin. but i have problem to utilize it. For example, i need to make a 100 post(I need them has different title, range from 1-100) without i have to copy-paste previous command and change its property value i'm sorry if my description is too vague. In nutshell, it's about how to create unit s...

Catch and log fatal errors, warnings, notices in Zend Framework

Currently I am using a basic error controller which looks like this: class ErrorController extends My_MyController { public function errorAction() { $errors = $this->_getParam('error_handler'); switch ($errors->type) { case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: case Ze...

can there be a advertisement container swf?

Here is my problem. My customers can give advertisement on my webpage. Earlier it was just image, a redirecting url, a title. On clicking on the advertisement, I counted the number of clicks and redirected to the given url. Now I want that they can upload images and swf files as advertisement. What I didnt know that you cant catch click ...

Postgresql php and bytesequence issue

I have set the html meta tag to uft8 Also the form charset to utf8 To be uber sure i have run the php function utf8_encode() on the offending string even after all this i am getting a postgres error when executing the query via the php function pg_query. Yet when i copy and paste the query into a command line it executes fine. The que...

Variable in a function cannot be seen out?

<?php function curl($mail){ $go = curl_init(); $access_token = '1234567890|5fabcd37ef194fee-1752237355|JrG_CsXLkjhcQ_LeYPU.'; curl_setopt($go, CURLOPT_URL,'https://graph.facebook.com/search?q='.$mail.'&amp;type=user&amp;access_token='.$access_token); curl_setopt($go, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows N...

PHP search engine problem

Im using Sphider as a search engine for my website, its really easy to work with but im having some major issues with localized characters. All of my html/php pages have the charset defined as UTF-8 and the search and result page from Sphider had charset=ISO-8859-1, when I first used the Sphider "spider" to crawl my website it made all ...

PHP solutions for storing forms in JSON

Forgive my second-rate google-fu, but I'm finding this topic tricky to search for. All I can find is crappy form-generators that will pump out HTML. I'm looking for a library or established approach to store forms (fields rather than form data) in JSON format. Is there either a open-source form-builder that takes simple input and makes ...

Protect website against PHP Curl post method?

Ok, let's suppose we have a form which allows people to post their comments. As you know, "bad people" can spam me with help of PHP Curl easily. How can I protect my website against that not including captcha? Thank you. ...

Symfony - set form value on save

Hi all, A quick question. I have a symfony form. When I save the form, I want my created_by field to be set automatically on save. So, i'm passing the current user id as an option in the form: $this->form = new ContractForm(null,array("created_by"=>$this->getUser()->getId())); And in the configure method of the form class I have: $...

Get content within a html tag using php and replace it after processing

I have an html (sample.html) like this: <html> <head> </head> <body> <div id="content"> <!--content--> <p>some content</p> <!--content--> </div> </body> </html> How do i get the content part that is between the 2 html comment '<!--content-->' using php? I want to get that, do some processing and place it back, so i have to get and p...

Cross browsers mult-lines text overflow with ellipsis appended within a width&height fixed div?

I made an image for this question, it's faster to me and should be easier to understand. I've tried some jquery plugins out here and there, but cannot find the one i'm looking for. Any recommendation? ideas? ...

YAML adapter for Zend_Translate?

Does anybody know a high-quality yaml adapter for Zend Framework's Zend_Translate? There seems to be a proposal in the Zend project itself, but it's been inactive for years. ...

Scaling Write Intensive App (LAMP, MySQL) (Catalog Style Application)

Hi, I was wondering if there's anyone out here who has experience with write-intensive data due to file import. The main requirement is for the business users to be able to import a data that represents relationships between master tables. They should be able to export the same in real-time ( as much as possible). Setup: front-end (...

Image Nudity Detection

Possible Duplicates: looking for nudity image filter that can test the adult image from other What is the best way to programatically detect porn images? Hi. I'm have a social networking website. Users can upload their pictures and share them with their friends. But some users upload porn images. I want to stop it. I tri...

Browser-based yaml editor, preferably in PHP?

Does somebody know an installable on-line editor tool for YAML data structures, one that an end-user could use, preferably written in PHP? No luck on the official yaml site. Open Source would be nice; commercial is an option. Clarification: What I need is a tool that shows each key/value pair of a YAML tree in a separate control to...

IIS 7 Completely Disable Caching

No matter what I do iis still caching my php files. I unchecked all caching options and rechecked configuration file and it seems okay. How should I completely turn off all kinds of caching? By the way my php file is quite simple its just echo "somestring" ...

Remove categoies, tagging and authors functionality from wordpress.

Hi, How do you remove the tagging and authors functionality from wordpress. This is so it does not appear in the backend for users, it would remove the categories panel from the post page and all the other flim-flam. I would assume that wordpress's default post is a special kind of custom post type that can be modified, and therefore ...

php/ajax browser problem

This could be considered a browser problem. It works in firefox, but not IE or Chrome: http://robotslacker.com/test.php the php file it's posting to is simply outputting a number. If you load it in Chrome it loads at 99. So the question is, how can i achieve the same affect on chrome/ie ...

How to get Am/ PM from a datetime in php

Hi I have a date time in a variable. My format is 08/04/2010 22:15:00. I want to display this like 10.15 PM. How to do this in php? Does any one help me? Thanks in advance ...