I'm trying to execute firefox on a headless server to take screen shots of a website. I can do this fine from the terminal using
"DISPLAY=:12 firefox -saveimage http://www.google.com/".
The problem is when I try to do system("DISPLAY=:12 firefox -saveimage http://www.google.com"); doesn't work. I have a feeling that it's not executin...
I discovered the Security Component in CakePHP helps to prevent CSRF by adding tokens as hidden values to forms.
What I was wondering is if there was anyway to prevent duplicate form submissions using this Component or some other component/helper?
In previous projects, I used a unique hash saved in a session, which is read then deleted...
I've got a Mac server and I'm building PHP code to allow users to upload images, documents, and even video files. Researching this has definitely gotten me nervous, I want the uploaded content to be virus free.
Is building something myself going to be a huge challenge? Would you do it, or would you find some OS or OTS product? (And do ...
I'm looking for the best (possible on most PHP 5.2 installs and still actively developed) way to detect a files MIME type in PHP.
I'm aware of the mime_content_type() method and the Fileinfo extension, however mime_content_type() is unreliable and deprecated, and Fileinfo doesn't come in a "standard" PHP (5.2) install.
Do I have any o...
Hello, during a lecture my professor gave examples of several actions involving databases and the java.sql package. These examples were supposed to be uploaded online in a pdf file, but for some reason the names of all functions and class names aren't displaying with my pdf reader.
I would like to know the equilavents of the following P...
What is the best method for communication between Flex and PHP?
In the past, we used AMFPHP with AS2, and it worked great for the most part (advantage of AMFPHP is that it also has a JSON mode that can let you seamlessly use the same remote PHP with either Javascript or Actionscript frontends).
However, it seems like AMFPHP isn't real...
Can a class extend both an interface and another class in PHP?
Basically I want to do this:
interface databaseInterface{
public function query($q);
public function escape($s);
//more methods
}
class database{ //extends both mysqli and implements databaseInterface
//etc.
}
How would one do this, simply doing:
class database impl...
I'm trying out SlickEdit and it says it can use a "tag file" for PHP. Does anyone know where I can find this tag file?
...
I have run into two situations lately where I have chosen to use the command line for doing something rather than the PHP library. For example, in PHP doing this:
`curl http://someplace.com`
instead of this:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec(...
Hypothetical situation. I want to populate/load a sales/order collection with every order where the grand_total is equal to the total_paid. I know I can use addFieldToFilter to filter by a specific value, but is it possible to use this method to filter by other database values. If not, is there any data access object in the Magento sys...
Very new to PHP5 and have some problems still. I figured out how to Select with prepared statements now trying to insert/update my code is as follows
function input_lab_results($name, $image, $descrip) {
$query = "INSERT INTO pat_table (pat_name, pat_image, pat_descrip, pat_doctor, pat_resident, pat_create, pat_modify) VALUES (?, ?, ...
I'm sure this has been asked before, but as I can't seem to find a good answer, here I am, asking... again. :)
Is there any way, using only a mixture of HTML, JavaScript/AJAX, and PHP, to report the actual progress of a file upload?
In reply to anyone suggesting SWFUpload or similar:
I know all about it. Been down that road. I'm looki...
I trying to write a drupal module. I'm following book "Learning Drupal 6 Module Development ". I have created a new content type (mybio)in module. I'm able create new node and edit node for new content type , it works fine but I'm not able to see new fields for mybio content type when viewing node.
I have placed mybio_info.tpl.php file ...
Has anyone had any success setting up Zend_Test? What was your method/approach and how do you run your tests/test suites?
I already have PHPUnit installed and working. Now I'm trying to write some simple controller tests. The Zend Framework documentation assumes that autoloading is setup, which I haven't done. What method do you use to ...
I am a long time PHP user when it comes to web applications and am mostlz comfortable with it. However, I have a one semi-large project whose maintenance / extensibility has reached its end of a life cycle. I was weighing on different PHP frameworks (there were no when the project originated), since it is the way to go for this project, ...
I need to read through an Apache httpd.conf file, and find the following line:
#LoadModule blah blah
and uncomment it, i.e., replace it with
LoadModule blah blah
The catch here is that since the conf file can vary, there is a real possibility that the LoadModule line has already been uncommented.
There is also a possibility that ...
How to use Query cache with ADOdb in PHP? Is it default in ADOdb or Is there any configuration needed ?
...
Here's a piece of code:
$obj = new myClass();
$obj->{$_GET["func"]}($_GET["param"])
It works based on variable variables, but I don't really understand how.
As far as I know, variable variables are used for stuff like this:
require "dbsettings.php"
$member_id = $_GET['id'];
$db = new DBconnector();
$vars = array('username','passw','e...
On my website I use PHP sessions. Session information is stored in files in my ./session path. After a few months I discovered that these session files are never deleted, by now there are 145.000 of them in this directory.
How should these be cleaned up? Do I have to do it programmatically, or is ther a setting I can use somewhere tha...
Given a certain date, whats the easiest way to determine how many days until that date (in PHP)? I am trying to build a count-down widget, Thanks!
...