I’m getting E_NOTICE errors in a core CakePHP file when it tries to reference a never-set or unset session (cake/libs/cake_session.php line 372): function read($name = null) { if (is_null($name)) …
How to determine path to php.exe on Windows – search default paths
I’m currently developing a couple of plugins for Sublime Text 2 on OS X and I would like to make them cross platform, meaning I have to find out if and where php.exe is installed. Right now I call /…
Specify Multiple Subdomains with Access Control Origin
I am trying to allow access to every subdomain on my site in order to allow cross subdomain AJAX calls. Is there a way to specify all subdomains of a site like *.example.com or alternatively, why does …
Keep a check whether a value if selected from dropdown list using PHP
I need to keep a check on whether a value is selected by the user from the dropdown box other than the default value which is at null position. If selected (any value other than default ) then I want to set a variable say $varSet = 1 and if not $varSet = 0, so depending on the $varSet value,
PHP/MySQL: Get name for specific ID
I am a beginner to MySQL and Im trying to retrieve a name for a specific ID. Here is how my database looks like: I have a table of contacts which contains ID, first and last name. I want to retrieve the first and last name for a specific ID in the same form. So I want to end up
PHP Conditions in Javascript code
I need to add a PHP condition inside some javascript code like this: $(document).ready(function() { <?php if (some condition) { $('#myID').show(); } }); Is …
Uploading multiple images with one input field
i have created a photography website with an admin page that uploads photos to different categories in a mysql table. This much works, but i can only upload one file at a time and i’d like to be able to select multiple images. Here’s the form And here’s the php for parsing the form I looked …
Completely arbitrary sort order in MySQL with PHP
I have a table in MySQL that I’m accessing from PHP. For example, let’s have a table named THINGS: things.ID – int primary key things.name – varchar things.owner_ID – int for joining with another table My select statement to get what I need might look like: SELECT * FROM things W…
PHP filter_input_array for $_FILES?
Is there a way to filter_input_array for $_FILES? I tried but it doesn’t seem to be the same syntax as $_POST: And after quick check of the Constants List shows that it isn’t an installed definition for filter_input_array. So, should I define it some other way? DEFINE(‘INPUT_FILES’ $_F…
A tool to automatically generate PHPUnit tests? [closed]
I was wondering – is there a tool which will look at my PHP code and automatically generate a PHPUnit test for it? Or is there a tool like this for any other language, which I might be able to port to …