-
Web Standards...
Yep. That's why you can add PHP code anywhere on a page, as long as it doesn't output anything to the browser. Whereas Javascript you can't. Big guns out there don't care if their site doesn't validate, doesn't make a big difference to them. The W3C standards are there as a comprise for cleaniless in code. Even sites such as lissaexplains.com doesn't adhere to W3C standards.
-
What books do you like to read?
Yep . I like reading computer books, that's it
- BBcode in Shoutbox / Chat
-
at what point do you stop supporting old browsers?
We still use HTML but we now use XHTML standards on top. I don't really check my sites in IE6, only the latest versions such as IE7 and FF3 (possibly FF2 too). I might check IE6 on my old desktop later on, however.
-
If you made a template/script what would you release it under?
If you created a script (let's say a forum) or a free Web template, what would you release it under? Would you release it under the GNU GPL where the copyright can be removed by users that use the software, or would you make it free (open source) but require a copyright to stay intact? I don't mind if I use scripts on my site that requires copyright to stay intact, such as the YaBB software - but I really do prefer GNU GPL software. Most of the times I don't remove copyright notices on any scripts I use on my site, this is why I make all of my scripts released under the GNU GPL license. How about you?
-
How to center content in IE?
To center content you can use two ways: body { margin-left:auto; margin-right:auto; } or body { margin: 0 auto; } ...this would be the same for every browser. It's true this won't work unless you have a valid doctype declaration, etc. Search Google for "XHTML tutorial" .
-
File Uploading Syntax
$_FILES['upload'] ...upload is the name (name="upload") of the HTML form. $_FILES['userfile']['name'] ...['userfile'] would be the name, ['name'] would be to reference the file name such as index.php or index.htm $_FILES['userfile']['size'] ...['size'] would be in bytes, to get it in kilobytes (KB) divide it by 1024 such as: $var=$_FILES['userfile']['size'] / 1024; $_FILES['userfile']['tmp_name'] ...the temporary name of the file uploaded by PHP. When you upload files via PHP, it is TEMPORARILY uploaded by PHP for that page refresh, else it is deleted. This is why we need to use move_uploaded_file() - and why is it in an IF statement? All IF statements are still executed by PHP, and they're trye and false operators, so if it succeeds it'll output whatever is in that IF statement.
-
BBcode in Shoutbox / Chat
You can use a variety of functions, the most common are str_ireplace and preg_replace. I'll do a str_ireplace() example. The function stands for string case-insensitive replace and it does exactly what it says on the tin. <?php $form1=$_POST['form']; echo str_ireplace("find","replace",$form1); ?> Here's an example using arrays: <?php $find=array("find","find1"); $replace=array("replace","replace1"); $search="find find1"; echo str_ireplace($find,$replace,$search); ?>