php

How to run multiple versions of Symfony PHP Framework

I have several web projects built with Symfony v1.0, but I am excited by the new features in Symfony version 1.4 (Improved security, native email support and improved performance). How can I continue to develop my 1.0 projects but also create a testing environment for version 1.4? ...

PHP script to automate getting email

Here is what i try to do, almost like wordpress or video, i like to create/generate and pop email account on my server, where you can send email (text) or/and attached picture and automate the process of posting that on a blog, or just adding that to a folder for a slideshow. Some time ago, i made a huge research about that, found some ...

Why a full stop, "." and not a plus symbol, "+", for string concatenation in PHP?

Why did the designers of PHP decide to use a full stop / period / "." as the string concatenation operator rather than the more usual plus symbol "+" ? Is there any advantage to it, or any reason at all? Or did they just like to? :o) ...

Game Development & Artificial Intelligence With PHP

Hello All, A friend of mine told me that it is possible to even create games with PHP. Is that really possible? Can we implement artificial intelligence using PHP? Looking for your ideas. Thanks ...

how to create the upload progress bar using javascript

hi all, i am using php to upload the file to server, HTML and javascript on the client side. i want to create a determinent progress bar which progress of the file upload,using javascript Regard, fresher ...

Smarty: how to evaluate string as a variable

Variable assigned in my template is {$testVariable_123}, where 123 is auto generated and is also assigned to template as {$autoValue} So in my template I want to get value of above variable. {assign var="anotherValue" value="testVariable_"|cat:$autoValue} So if I print {$anotherValue} instead of value I get string 'testVariable_123' ...

Line break not happening in CSV file being generated by IE

I am using following PHP code to generate CSV file: header("Expires: 0"); header("Cache-control: private"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Description: File Transfer"); header("Content-Type: text/csv"); header("Content-disposition: atta...

Standard idiom for adding new models to an app built on Symfony + Doctrine

What is the a standard way of adding new model to my app built on Symfony + Doctrine while maintaining all previous models and their meta-data (like relationships). What am I really looking for: A command / procedure that will be equivalent of ./script/generate model FooModel in Ruby on Rails (which does not have any sort of reset db / ...

eclipse autocompletion from class file?

when i use netbeans and includes a class in a phpfile and then type $class_name-> it will show all functions and properties of that class. how can i do that with eclipse? ...

What does & in &$data do?

A quick beginner's question in PHP. What does & in &$data do and what are differences with $data? function prepareMenu(&$data) { $this->db->where('parentid',0) ... ... ...

Problems reading any messages in my gmail inbox using php imap

<?php $inbox = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", "****@gmail.com", "*****", OP_HALFOPEN) or die("can't connect: " . imap_last_error()); $check = imap_check($inbox); print_r($check); imap_close($inbox); ?> o/p stdClass Object ( [Date] => Tue, 8 Dec 2009 17:06:46 +0530 (India Standard Time) [Driver] =>...

populating different data with select onChange in php

Hi, i need some clarification on how to populate select(s) with data from mysql. Basically what I am trying to do is: There will be a first select box with some data in it. <select> <option>1</option> <option>2</option> <option>3</option> </select> when the user selects a option in the first select, there is a second select ...

html php and select box simplification

Is there a better way to structure this, using html and php? If I had a billion values, this would be a bad way to set them up, not to mention time consuming as well? I am a newb, and I am pretty sure there is a better way, however, my way of doing it seems to be the long way, as in long division, I am pretty sure there are easier meth...

Deleteing files in the root dir of my dedicated server with PHP

Hi I have a apache dedicated server with lost of websites. I also have a red5 installation on the server. What I want to know how to do is perform file functions - specifically unlink() - on files held in the RED5 directory within the root server dir. I can move files with this: copy ("http://www.parttimepornstar.com:5080/echo/strea...

How to profile SQL queries in MVC framework?

Hello All, I have been working on my own php MVC framework. I just wanted to get your ideas on how to profile all the queries run on my framework. I have done other profiling stuff but i have no clear idea of how to profile the sql queries too for the users to see if they turn profiling on. Thanks ...

Working with HTML Entities

I am storing HTML code in my MySQL table column. For inserting records, I framed the query like this: $InsertQuery = "INSERT INTO listing (ldate, places, company, designation, projectdetails, desiredcandidate, hrname, hrcontact, email) VALUES (DATE_FORMAT('" .$ldate ."','%Y/%m/%d'),'" .$places. "','" .$company. "','" .$designation. "','...

Zend_Input_Filter - how to add several validators to 1 data field

What is the right way to assign a few validators to the same data field when using Zend_Input_Filter. E.g. my validators array is this and I need to validations on Field2: $validators = array( 'Field1' => array( 'NotEmpty', 'messages' => 'Field1 must be filled' ), ...

Conditional statement operands order

Often I stumble upon following approach of defining conditional statement: if(false === $expr) { ... } I have several questions about this. Is there a point of using constant value (false, 1, 0, 123, 'string' etc) as a first operand instead of second in cases when second operand is not too long. For example, I would prefer to...

jQuery validation plugin: How to create your own messages

I am using jquery validation plugin with php on ubuntu. I am applying validation on my forms like this: $(obj).find("form").validate(); When I set "email" as class of any text field and I give it a wrong formated email address, it show the following error like this. Please enter a valid email address. Question: Above message is ve...

PHP equivalent of UNIX_TIMESTAMP() of MySQL?

In MySQL: select UNIX_TIMESTAMP('2009-12-08 21:01:33') ; I need to get the value from PHP. ...