Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
You could do something like this: <?php function custom_error_handler($errno, $errstr, $errfile, $errline, $errcontext) { echo <<<EOF <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <title>Application error</title> </head> <body> <h1>Application error</h1> <p>We're sorry, but we encountered an error in the script and are therefore unable to continue. We apologize for an inconvenience this may have caused.</p> </body> </html> EOF; die(); } set_error_handler("custom_error_handler"); ?> With that you are also able to make some logging functions.
-
Automated queries to Google are against their Terms of Service and you risk getting your page banned. I.e. you are not allowed to check your PageRank with a script.
-
You could do something like this. Name your file something like: <?php /* Database structure: -------------------------------- | id | mime | filename | views | -------------------------------- */ $config = array( 'db_host' => "localhost", 'db_user' => "root", 'db_pass' => "", 'db_name' => "your_database", 'image_path' => "/home/somebody/images/", // needs trailing slash! ); $db_link = @mysql_connect($config['db_host'], $config['db_user'], $config['db_pass']); @mysql_select_db($config['db_name'], $db_link) or die(); $query = @mysql_query("SELECT * FROM images WHERE id='".intval($_GET['image_id'])."' LIMIT 1", $db_link); if(@mysql_num_rows($query) <= 0) { die(); } else { $image_info = @mysql_fetch_assoc($query); @header("Content-type: {$image_info['mime']}"); @readfile($config['image_path'].$image_info['filename']); } @mysql_close($db_link); ?>
-
I don't quite get what you mean... Can't you just use one of the variables you use for your title in the "above the comments box"?
-
What do you think of GoDaddy's hosting service???
Daniel0 replied to rantsh's topic in Miscellaneous
You could try out the demos at: http://www.cpanel.net/products/cPanelandWHM/linux/try_cp_whm.htm There is demos for the current version and the beta version of v11. -
Works for me as well. You could also make it tell people what city they are in...
-
php code library ---- Its empty!!!
Daniel0 replied to larry777's topic in PHPFreaks.com Website Feedback
I suppose it is because nobody has added anything. There aren't any submissions that are awaiting approval either. -
Did you even read the manual? strtotime does not have the same syntax as strftime. A good idea might be to use a combination of both: [code]$time = strtotime(strftime("%Y%m%d%H%M"));[/code] It should get you a UNIX timestamp.
-
You should use strtotime, not strftime.
-
The first thing I noticed (and immediately annoyed me) was the "optimized for ..." notice at the bottom. A webpage shouldn't be optimized for a specific browser and/or a specific resolution. You need to make sure it works in all browsers at all resolutions.
-
Remove the copyright notice from the title. Remove the underlines from the navigation links on the top of the page. I don't like animations (that include your logo too).
-
You should be aware that the server edition does only give you CLI, but you can install a window handler this way: [code]aptitude install ubuntu-desktop[/code] If you are using it as a test server only, then I don't think there should be any problems running it.
-
Does it really cost a lot to host a medium traffic website?
Daniel0 replied to twilightnights's topic in Miscellaneous
Whether it will use 2tb bandwidth per month depends on what content his site provides. E.g. if it is a filesharing service the bandwidth usage could add up really quickly. -
Turn display errors on and set error reporting to E_ALL and see if there are any errors on the page.
-
Yes. You need to open port 6667 in your router. Make it forward it to your computer.
-
You can use COM (http://php.net/com) for that. This PEAR extension generates Excel files: http://pear.php.net/package/Spreadsheet_Excel_Writer
-
businessman332211: According to your website you are capable of administrating Linux and Windows web servers along with being able to use Windows' and Linux' CLI. If that is true, then why do you keep asking for help on how to setup a web server? Or maybe you're just lying to your clients...
-
Just set it up manually. When installing PHP, don't download the installer, download the zip package.
-
Do you have a proxy enabled in IE?
-
[code]trim("LOT OF SPACES HERE WOOT FOR SPACES ");[/code] returns: [code]LOT OF SPACES HERE WOOT FOR SPACES[/code] So I am afraid your function isn't valid.
-
Heh. Check this out: http://thedailywtf.com/Articles/Disjoint_Twins.aspx
-
Would probably help a lot.
-
Unfortunately, it is a very good dictionary (latest version) from one of the most recognized publishers of dictionaries in Denmark. You'd almost never find any teacher that wouldn't recommend that you buy your dictionary from them. I have no idea why they use such legacy code/libraries though. I found out they have a support site, so I'll try there. Also, the dictionary works on other computers, just not mine >_<
-
In large forums this might be too CPU extensive, but in small to medium-sized forums that could be really great.
-
Also [tt]<?=$some_var?>[/tt] won't work on some servers. You would need [tt]<?php echo $some_var; ?>[/tt] (I think the semi-colon is optional in this case, but I just prefer to have it like that).