I have the following constructor:
public function __construct(){
foreach($_GET as $key=>$value){
$_GET[$key] = addslashes($value);
}
$this->get = $_GET;
}
and it's used like so:
$app->get['id']
Where 'id' is the parameter being passed through the URL.Is there a good way to sanitize all the data through the const...
Does anyone know how to convert a number such as 1, 2, or 3 to their text version (one, two, three) in PHP? I only need to convert from 1 to 99. I know I could write a huge switch statement but that would be ridiculous.
...
In my Wordpress-powered website (http://onomadesign.com/wordpress/identity-design/usx-corporation/ for example) I want the sidebar.php, the thumbnail navigation on the right, NOT to reload when people click another project. So that they not get lost in navigation.
Now, I have looked at iframes, jquery cookies, 'AHAH-method', php session...
In a PHP web application I'm working on, I see functions defined in two possible ways.
Approach 1:
function myfunc($arg1, $arg2, $arg3)
Approach 2:
// where $array_params has the structure array('arg1'=>$val1, 'arg2'=>$val2, 'arg3'=>$val3)
function myfunc($array_params)
When should I use one approach over another? It seems that i...
Another question about Drupal webforms --
The form itself is built in by /includes/form.inc's
function theme_form_element($element, $value)
and adds a <label> element to the $output. I want to remove that label only for one webform, so I have to override the function.
How can I override it for only one webform, while leaving it the sam...
I'm having a hell of a time trying to find information on the comparative costs of developers between these three platforms.
I would expect PHP and ASP.NET developers to be in the same ballpark due to the size of both development communities. However, Coldfusion has what, a half million developers? That's a medium size, but it's a relat...
I have a few functions that should return an array, to have it merged with another array.
However, sometimes there's nothing to return.
What's the best scenario here?
Return an empty array and merge that with the full one OR
Return null, store the return in a variable, check that variable and THEN merge it if needed.
I'm asking this...
I got a MySql database that I do some potentially large queries to. The data I get from the query is stored in a 2D array in PHP which then generates a HTML table for the user to see. Currently I'm trying to implement a way to sort the data in various ways for the user. Of course I could just call the query again and tell it to sort in a...
Say I have a couple multi-demensional arrays with the same structure like so:
$basketA['fruit']['apple'] = 1;
$basketA['fruit']['orange'] = 2;
$basketA['fruit']['banana'] = 3;
$basketA['drink']['soda'] = 4;
$basketA['drink']['milk'] = 5;
$basketB['fruit']['apple'] = 2;
$basketB['fruit']['orange'] = 2;
$basketB['fruit']['banana'] = 2;
$...
All,
I am just trying to view any page at all besides the “Welcome to Zend Framework” screen.
I have downloaded the project from this tutorial:
http://framework.zend.com/docs/quickstart/create-a-form
(Zend Framework Quickstart)
As far as I can tell, the paths are coming up correctly. I read this post:
http://www.johnmee.com/2008/11/z...
I need to create an ImageIcon from an image on a remote server. When I loaded it with a URL like http://www.server.com/1.png it worked fine.
But recently the server was changed so that the images are stored outside of web root and must be accessed with something like http://www.server.com/get_image.php?id=1, where get_image.php outputs...
How would I list the first 5 files or directories in directory sorted alphabetically with PHP?
...
If you allowed people to determine who could view their user information, what would be the best way in which to store and access that information?
They would be setting their preferences in any of these ways:
User Based (select specific users - ie. Block: "Munch", "Dummy")
Checkbox Based (select one or many groups of users - ie. "My ...
If a PHP session variable is stored on file (like it is by default) then let's say I store a user's name into a session variable...
$_SESSION['username'] = 'Jason Davis';
Now when a page is built, if I call $_SESSION['username'] 100 times in the process of building a page, would it hit the session files and do a read on them 100 tim...
Hello all, My newbie question of the day is....
I have a comment function on my site that I have 3 versions of for the same page. I have one that has specific traits for A. signed in and looking at own profile B. signed in looking at someone elses profile C. Not signed in at all
I have it working just great depending on what criteria t...
I am having some permissions problems with mkdir in PHP. I am trying to simply move some files around (and create a folder to put them in), but I am getting this error:
mkdir() [function.mkdir]: Permission denied in
On my old site, I had my folders set to 755 and things seemed to work fine. It seems like the only time I can get mkdir ...
I have created a Car content type with taxonomy vocabularies and CCK fields to describe make, model, year, price, color, ect. My site will contain very little content aside from cars, and I want to implement a search form similar to the one found on http://openautoclassifieds.com/search.php. The select boxes allow users to choose from va...
I have following
$var = "2010-01-21 00:00:00.0"
I'd like to compare this date against today's date (i.e. I'd like to know if this $var is before today or equals today or not)
What function would I need to use?
...
Is there a way to check the version of PHP that executed a particular script from within that script? So for example, the following snippet
$version = way_to_get_version();
print $version;
would print 5.3.0 on one machine, and 5.3.1 on another machine.
...
I just started using NetBeans 6.8 with XDebug for some remote debugging I need to do. I think I have everything configured correctly, but I don't see a program counter while I'm debugging, so I have no visual indicator of what line is about to be executed.
Normally, it should show a green arrow in the gutter, and a background color on ...