You could get the image dimensions and use them when drawing the image. For example,
// Draw Logo
$imagePath = "../users/".$this->user."/logo.jpg";
list($width, $height, $type, $attr) = getimagesize($imagePath);
$image =...
<?php
$array = array (
'anteater',
'bear',
'cheetah',
);
function cmp($a, $b) {
return strlen($a) - strlen($b);
}
usort($array, 'cmp');
print_r($array);
?>
If the string you want to search are in a file, then:
$array = file('filename.txt', FILE_IGNORE_NEW_LINE);
You probably mean you get a backslash ("\"), not a forward slash ("/"). If this is the case it is probably caused by the magic_quotes feature of PHP. The best thing to do is probably disable magic quotes by adding the following to your .htaccess file:
php_flag magic_quotes_gpc off...
To use transactions, you just need to execute the right queries from your PHP script (obviously make sure your database supports transactions):
mysql_query("START TRANSACTION");
mysql_query("UPDATE t1 SET field='value1'");
mysql_query("UPDATE t2 SET field='value2'");
mysql_query("COMMIT");
If...
I guess the pages you want to copy are not http password protected. What form of password protection do they use? If they are cookie or session protected, then you'll need something more complicated. It is possible to support cookies with http wrappers, but not obvious. Using libcurl might be a...
If you still get the parse error, post your PHP code and we should be able to help you. As a guess, it may be that you've added a quote character without escaping it. e.g.
echo '<div id='text'>See how easy it is to copy this?</div>';will generate a parse error. To fix it, you need to escape...
If site1.com and site2.com are maintained by different people and site1.com includes the following code on their server:
<?php echo file_get_contents(urlencode("http://www.site2.com/file.html")); ?>then the owner of site2.com could inject site1.com with an XSS script. Also, if site2.com is...
The following should do what you want. It needs FTP and ZIP support compiled into your PHP installation.
<?php
////////////////////////////////////////////////////////////
// START OF CONFIGURATION
////////////////////////////////////////////////////////////
// Set to the directory...
This won't work if you swap the search words round. Your final query would be:
SELECT * FROM `$table` WHERE title LIKE '%gtb%ferrari%'
which would not match.
As an alternative to mholt's answer, you could use str_replace to replace spaces with additional parts of the query something...
Two alternatives - a soft link or mod_rewrite. Soft links don't always work (apache can be configured to disallow them). mod_rewrite may not be supported on your server (ask your host).
If you have shell access, login, then:
cd public_html/new.com
ln -s ../arcade .
If you don't have...
The ? has 2 different meanings, depending on context.
After a normal character or expression is means one or zero occurrences of.
After a normally "greedy" operator it makes it non-greedy.
Greedy means that the operator will match as much as possible. * is normally greedy, so the if you...
Yes - you can do this without downtime.
First, you need to get your new hosting account setup. Use the control panel to create your subdomains, then add all of your content to it using FTP and the IP address of the server.
You may be able to test your new site using a preview URL (e.g. if...
Your web is configured incorrectly (IMO - your admin may disagree :red:).
You could try to persuade them to change their mail server configuration to send to MX records rather than delivering to the local address.
Alternatively, you could bypass their mail server and go straight to...
I don't believe it makes a difference to the search engine ranking. I've got a .info that appeared as #1 for a single word search term for several years (now #4).
I do however believe it makes a difference to how likely a visitor is to click on a search result. For me, a ".info" is fine if...
You can use:
Redirect permanent /deleted_file.html http://www.yoursite.com/
Or you could use a custom 404 page which redirects (this is what I do on some of my sites):
in .htaccess add:
ErrorDocument 404 /404.php
Create a new file called 404.php with the following:
<?php...