Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - yuri

Pages: [1]
1
Web design and coding tips / The first PHP tip
« on: December 14, 2007, 03:51:06 PM »
If you plan to use PHP applications on your site, my first advice to you is to make sure that the 'register_globals' option is disabled. That option is one of the easiest ways for a hacker to break into your site and gain full control over its contents.

To see what is your site's PHP configuration in general and in particular whether 'register_globals' is On/Off you should create a file 'phpinfo.php' with the following contents:

Code: [Select]
<?php
phpinfo
();
?>

and upload it to your site.

Then open in the browser the URL to the 'phpinfo.php' script: http://www.yoursite.com/phpinfo.php

Search for 'register_globals' to go directly to the appropriate line.

In case 'register_globals' is On, ask your hosting provider to disable it.

I think it is a good idea to remove the 'phpinfo.php' file once you are done with it - no need to show to the world the details of your site's PHP configuration.

2
Web design and coding tips / When to use CSS @import and when the link tag
« on: December 12, 2007, 11:47:43 AM »
I found out about the CSS @import declaration when I saw it used to import the main stylesheet of the page:
Code: [Select]
<style type="text/css">
@import url("main.css");
</style>

This raised the question of when should you use the link tag:
Code: [Select]
<link rel="stylesheet" type="text/css" href="..." media="screen" />and when the @import technique.

After a quick search in Google (plenty of info on the subject) I found out that using @import from the HTML directly was used in the days of yore to apply different styles for different browsers. Now a days this use is kind of irrelevant.

@import's original purpose is to modularize CSS styles (a good article on the subject) and it is better to use it like that and not to import the main style sheet. For the main / master stylesheet of the page one should use the link tag.

Pages: [1]