I've just created my first website (congratulate me). And I want to upload it but although I don't have access to many different computers, I've opened my webpages up on google chrome, internet explorer and firefox and the style looks slightly different. So apparently what I need to do is create 3 different versions (in term of the style) and open up different versions depending on what browser the viewer is using. Is this correct? Hopefully I can find a good tutorial online for this.

Second question...
I remember hearing somewhere that depending on different pixels each computer is using, things look different or something - I'm not too sure. Can someone tell me if I'll have to change the "px" stuff around in all of my code. Please tell me this isn't true!

Third question...
I use mysql to store data in and on top of all the code files i connect to it with

$con = mysql_connect("localhost","name","password");

when i upload my site would people not just be able to go to view page source then use that to hack into my database :/

Final question...
Currently in the <a href> links I link to pages like "./images/whatever.jpg". Once I put the website online would I need to change all of these links in accordance with whichever hosting provider I'm using.

Sorry it was kind of long but if you have time please brief me on these topics. Will be appreciated!

5 Years
Discussion Span
Last Post by asif49

First of all, congrats! :)
You don't need to write different versions of the same page. Sometimes you need to apply some little adjustments, just grab a CSS tutorial/book and learn from there.

Pixels are always the same on each computer, if you set a page at 900px it will look the same on each computer. But if you want an adaptive design, then use % or em. Search for tabless/fluid design.

The connection string can be saved into another file, you can use include() or require() to use it. Usually php page are processed by the server and only the output (echo, print...) is sent to the browser.

You are using relative links, it's better to use absolute paths, if you put your images/ directory into the root of your web server than remove the dots from the link <a href="/images/whatever.jpg"> will work.


Browsers don't do everything exactly the same and they aren't all as strict in enforcing the rules. Generally speaking, if you follow the rules and code your html and css properly, then all of the browsers, except for Internet Explorer should display something very similar. Internet Explorer is often the exception. Sometimes you can find a solution that works in IE and all of the other browsers but sometimes you need special code for IE. If you do a search, you can find more info on that.

Web pages are displayed on screens of all different sizes. If you display your web page in a window (rather than full screen) and you vary the size of the window, you can see the impact of making the page different sizes. Web pages can be a fixed size and left adjusted or centered. They can also expand and contract based on the size of the screen /window. Whatever you do, it's a compromise. The only thing that doesn't work well is when the page is larger than the width of the screen so the user has to scroll horizontally to see all of the content.

You can protect the directory on the server so the list of modules can't be viewed. Users can execute your PHP modules but they can't view them. You would still be better off putting the ID and password in a config file that is included in your program and the variables inserted into your connect statement. The config file can be protected so it can only be accessed by the system.

If you keep the same directory structure on the server that you have on your test system and if you use relative link addresses, then they will still work on the server.


Cheers for congratuling me! And it is great to know that pixels are the same on each computer. Big relief!

And I have just been testing it with internet explorer. it looks slightly (but not very) different on there, seeing as ie isn't one of the top browsers any more I may just leave it.. Thanks for such concise responses guys. You've answered my questions :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.