Jump to content

Help with uploading website to host


misheck

Recommended Posts

I have just completed my very first php & mysql website after 1 1/2 years of trying to get into website development. Now what I need to do is to upload it to my website host but I am not sure where to keep my config.php file because this where I have all my database connections passwords etc. In my studies I have heard I am suppose to keep that file in htaccess protected folder but I am not 100% sure on all that.

 

Can some please advise what precautions I should take when uploading my first website.

Link to comment
Share on other sites

PHP is a serverside language, meaning anything within the PHP files (save for output) Cannot be viewed by the user. Database passwords can be stored directly or via an include (usually a common practise) but there is no security risk involved with either way.

 

The only possible way to view them is through an exploit on a poorly programmed script (SQL/path injection) or via FTP. I'd recommend you read up on common security practises revolving around sanitizing input from the user.

 

mysql_real_escape_string

--

Some security methods, quite handy

Link to comment
Share on other sites

For one step towards better security it is sometimes recommended that you put your code outside of your web folder and include from there (the code that needs better security, passwords and so on). For example in unix/linux systems you could make "../home/php_application/inc" folder and put your includes there that you want to "hide". I've found this to be less convinient to update etc so I haven't used this method a lot with my applications. But if you need more security this is something you can do.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.