I saw this HTML minifier in Ajaxian and it made me wonder if its really a big improvement for webpage to minimize HTML, PHP or CSS files or it doesn't make any big difference? (assuming that they are 100 lines long in average)
...
Hi everyone, I am still trying to figure out how to fix my pagination script to work properly.
the problem I am having is when I click any of the pagination number links to go the next page, the new content does not load. literally nothing happens and when looking at the console in Firebug, nothing is sent or loaded.
I have on the mai...
I have a credit system set up on my site where user A can purchase a document from user B, let's say for 1 credit and user B's account gets credited, let's say for $1. User B can then "cash out" and recieve the money they earned from my (the site's) PayPal account into their PayPal account (let's assume that their email address is valid ...
I'm working on a simple search engine for a newspaper application. When the user types a keyword, a results page is shown, highlighting the term with a color.
I'm currently doing this:
$title = str_ireplace($term, "<span class='highlight'>$term</span>", $note->Title);
Great, str_ireplace() makes the case-insensitive search, but when ...
Sorry, I'm not really sure of the right way to ask this one so bear with me...
We have a web application that runs on a set of servers at a data center (not in our offices)
We want to be able to somehow 'advertise' to our clients/users that the availability or response time of our servers has met a standard throughout the day.
I am bei...
Hi, i think this is a bit of a noob question, but here goes.
I am trying to get a better understanding $_GET variables in PHP. A lot of CMS's etc convert things like site.com/?ID=42 into something like site.com/42
My question is, what happens to the $_GET variables when this happens? I try and print the GET array on page load, and it i...
Can someone provide a working example in which stored procedure returns a recordset and is called by using prepared statemet?
...
i know there is a convert -swirl effect in imagemagick but can i create other effects for text like curved, arched, wedged, pinched etc.. just like wordart in word.
i am open to other packages that might help me get this thing done.. php or ruby..
...
How would I go about creating a tripcode system (secure) for a message board I'm custom making? I'm only using PHP and SQL.
...
I'm having trouble getting the compressed jpeg image (stored as a blob in my database).
here is the snippet of code I use to output the image that I have in my database:
if($row = mysql_fetch_array($sql))
{
$size = $row['image_size'];
$image = $row['image'];
if($image == null){
echo "no image!";
} else {
...
This is a contrived example, but it illustrates my problem much more concisely then the code I'm using - and I've tested this and it exhibits the problem:
$image = imagecreatefromjpeg('test.jpg');
$copy_of_image = $image;
// The important bit
imagedestroy($image);
header('Content-type: image/jpeg');
imagejpeg($copy_of_image);
No...
Hi,
I have XAMPP installed on a windows 2000 server. everything is working great except the PHP fopen function. I can neither create nor open files with it. the strange thing is that i can include/require/file_get_contents/other file related functions; also fopen does not generate any errors or notices it just returns NULL.
I have gone...
I have two class named test in two different files,a.php and b.php for instance,the logic is like this:
include('a.php');
$a = new test();
if($somcondition_is_met)
{
include('b.php');
$b = new test();
}
Is there some trick to avoid Fatal error: Cannot redeclare class ?
...
I need to pass the $route to its inner function,but failed:
function compilePath( $route )
{
preg_replace( '$:([a-z]+)$i', 'pathOption' , $route['path'] );
function pathOption($matches)
{
global $route;//fail to get the $route
}
}
I'm using php5.3,is there some feature that can help?
...
in my php page i have:
<?php
setcookie("game", "GOW2", time()+3);
echo $_COOKIE["game"]."</br>";
echo "<a href=\"/mypro/mypro2.php/\">Refresh</a></br>";
?>
now i want at page load or when user clicks on 'Refresh' the following functionality
the timer should get reset and get displayed (as a countdown) and this countdown goes ti...
I was trying to find this answer on Google but I guess the symbol & works as some operator, or is just not generally a searchable term for any reason.. anyhow. I saw this code snippet while learning how to create wordpress plugins, so I just need to know what the & means when it precedes a variable that holds a class object.
//Actions ...
I'm trying to use autoloader with phpunit this way:
in phpunit.xml I put bootstrap="bootstrap.php"
in bootstrap.php I put
define( 'TESTING', true );
putenv( 'APPLICATION_ENV=testing' );
function __autoload($className) {
include_once __autoloadFilename($className);
}
function __autoloadFilename($className) {
return...
I'm having trouble simplifying this conditional statements logic. Is there a more effervescent way of writing this?
if(($x || $a) && ($x || $y))
{
if($x){
return true;
}
}
return false;
...
Does every level of view helpers really have to be added as its own separate path?
What I mean is this. I have found Zend's method of naming and nesting files a great way to organize user.php lives in the object folder and extends object.php.
/DisplayObject
/Object
User.php
I started attempting to organize my view helpers i...
How to rewrite this in pdo:
$con = mysql_connect("localhost:".$LOCAL_DB_PORT, $LOCAL_DB_USER, $LOCAL_DB_PASS);
mysql_select_db("xnews", $con);
mysql_query("set names utf8", $con);
Thanks in advance!
...