Edit: Great points all around, dedicated templating language is obviously the way to go. Thanks! I wrote up this quick class to do templating via PHP — I was wondering if this is easily exploitable …
Tag: php
phpmyadmin – default to structure instead of browse
Can I set the default in phpMyAdmin to open in structure instead of browse? thanks
select field information with min time value
I thought I was doing the right thing but I keep getting the wrong result. I am trying to simply find the id of the entry with the min time, but I am not getting that entry. $qryuserscount1=”…
How do I display exception errors thrown by Zend framework?
I am working with Zend framework and just hate the fact that I seem to encounter hundreds of exception errors like if I try to reference a non existant property of an object my application just dies …
Creating an XML sitemap with PHP
I’m trying to create a sitemap that will automatically update. I’ve done something similiar with my RSS feed, but this sitemap refuses to work. You can view it live at http://designdeluge.com/sitemap….
PHP file_exists and wildcard
Is there a way to write the PHP file_exists function so that it searches a directory for a file with an arbitrary extension. For instance, suppose I knew that a file were called “hello”, but I didn’t know the extension, how would I write a function that searched for a file called hello.* and…
Call private methods and private properties from outside a class in PHP
I want to access private methods and variables from outside the classes in very rare specific cases. I’ve seen that this is not be possible although introspection is used. The specific case is the next one: I would like to have something like this: This method should be able to be injected in the code l…
What is mod_php?
While going through a Zend tutorial, I came across the following statement: Note that the php_flag settings in .htaccess only work if you are using mod_php. Can someone explain what that means? Answer mod_php means PHP, as an Apache module. Basically, when loading mod_php as an Apache module, it allows Apache…
How to prefix a positive number with plus sign in PHP
I need to design a function to return negative numbers unchanged but should add a + sign at the start of the number if its already no present. Example: It will get only numeric input. This function is going to be called several times in echo/print so the quicker the better. Answer You can use regex as: But I …
What is the scope of require_once in PHP?
Simple question: Is the scope of require_once global? For example: