I have a website whose maintenance I've inherited, which is a big hairy mess.
One of the things i'm doing is improving performance. Among other things, I'm adding Expires headers to images.
Now, there are some images that are served through a PHP file, and I notice that they do have the Expires header, but they also get loaded every tim...
Lets say I have a 10,000 digit number in my database...
This would be laggy for the viewer if it was echoed out.
Is there a way to display only like 100 (the first 100)? Digits?
-Either using php, or (Pref.) using MySQL to only get the first 100...
...
I'm sure there is an easy way to do this, but I can't think of it right now. Is there an array function or something that lets me search through an array and find the item that has a certain property value? For example:
$people = array(
array(
'name' => 'Alice',
'age' => 25,
),
array(
'name' => 'Waldo',
'age' => 89...
Hi all,
I looked through the Wordpress Hook DB and couldn't find any way to change the page that wordpress redirects to after editing a user... Does anyone know of a hook that will do this, or of another way I could accomplish the same thing?
...
I'm using jWYSIWYG in a form I'm creating that posts to a database and was wondering how you can prevent a malicious user from trying to inject code in the frame?
Doesn't the editor need brackets (which I'd normally strip during the post process) in order to display styles?
...
Hey guys, I created a list for fixtures.
$result = mysql_query("SELECT date FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' GROUP BY date");
$i = 1;
$d = "Start";
while ($row = mysql_fetch_assoc($result))
{
$odate = $row['date'];
$date=date("F j Y", $row['date']);
echo "<p>Fixture $i - $d to ...
I have a client who is wanting to create a link which contains product codes so that his customers hit a page with just those products displayed in an attempt to increase conversion rates from affilliate sites.
My question is whats the best way to send these multiple products in a single URL
For example:
http://www.mydomain.co.uk/besp...
What is easiest way to display the current time in PST (West Coast) time using PHP?
...
Why is it possible to create an interface without specifying a return type? Why doesn't this make this interface unusable?
This makes it more Clear:
Interface run
{
public function getInteger();
}
class MyString implements run
{
public function myNumber()
{
}
public function getInteger()
{
retur...
All,
I have a PHP website written in Zend Framework and MVC. Most of the controller actions check if the request is an Ajax request or not, else they redirect the user to home page. I am thinking about various ways to break that site. I am considering the following scenario:
A user creates his own PHP project on his Local machine.
Use...
Hi !
I have pictures in a database and i want to read it out and display it as a picture.
However i get strange long charakters as result.
my code:
<?php
/**
* @version 1.0 $
* @package HelloWorld
* @copyright (C) 2010 BlaBlbb
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
/** ensure this file is being included by a parent...
How do these filters affect the output of imagepng() in PHP?
PNG_NO_FILTER
PNG_FILTER_NONE
PNG_FILTER_SUB
PNG_FILTER_UP
PNG_FILTER_AVG
PNG_FILTER_PAETH
PNG_ALL_FILTERS
The documentation simply says, "A special PNG filter, used by the imagepng() function" for each of them.
It seems that using PNG_NO_FILTER will reduce the filesize of...
Hi,
I just pointed newdomain.com to a folder(olddomain.com/folder) on my deluxe hosting account with Godaddy. The olddomain.com/folder has a Wordpress installed in it.
When using newdomain.com none of the images show up but work when i access the site from olddomain.com/folder.
I notice that when I enter the admin section for the Word...
I am testing various methods to read (possibly large, and very often) XML configuration files in PHP. No writing is ever needed. I have two successful implementations, one using SimpleXML (which I know is a DOM parser) and one using XMLReader.
I know that a DOM reader must read the whole tree and therefore uses more memory. My tests ...
I suffered a CakePHP Route Problem. I can only access the root "/" and it shows the CakePHP default welcome home page. Later I try to write my controller (icons_controller.php) and views (views/icons/index.ctp), it has problem. I typed in http://localhost:8080/myapp/icons/ It always says "Not Found The requested URL /myapp/icons/ was not...
I have an Array in PHP which contains data from database. And it prints out also as a table in the same page which has an AJAX delete function.
Trying to explain better
The array contains debt sums related to many people, it is the application's main function. In the same page, there is a table containing every debt record related to ...
Hi, for a certain project, I need some way to parse XML and get data from it. So I wonder, which one of built-in parsers is the fastest?
Also, it would be nice of the parser could accept a XML string as input - I have my own implementation of thread-safe working with files and I don't want some nasty non-thread-safe libraries to make my...
What is the best way to gray out text inputs on an HTML form? I need the inputs to be grayed out when a user checks a check box. Do I have to use JavaScript for this (not very familiar with JavaScript) or can I use PHP (which I am more familiar with)?
EDIT:
After some reading I have got a little bit of code, but it is giving me probl...
How do I get to display the number of posts on a topic like a forum. I used this... (how very noobish):
function numberofposts($n)
{
$sql = "SELECT * FROM posts
WHERE topic_id = '" . $n . "'";
$result = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($result);
echo numb...
Hi,
I create custom CMS sites and then go ahead for the backend/admin side. Is there any tool out there to automatically create admin side of my sites, for example, based on table relationships or whatever customization we may put in place.
PHPMaker seems to claim something like what i ask for but i have not used it. Any tool out there...