Page 1 of 1

Php script downloaded what now?

Posted: Thu Jan 26, 2006 7:23 am
by smartmove
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi

I recently purchased a php script  and I am just learning php, wonder if you could tell me if this part finished script is correct so I can load up on ftp? I have removed part of the passwords :-

Code: Select all

<?php

$cfg = array();

/*
* Database Credentials
*/
$cfg['db_user'] = "user pass"; 
$cfg['db_pass'] = "00000";
$cfg['db_host'] = "mysql6."; 
$cfg['db_name'] = "cleverli"; 

/*
* Database Table Names
*/
$cfg['adverts'] = 'adverts';  
$cfg['news'] = 'news';

Also:-
/*
* Where to store your adverts (Must be writable, chmod 777)
*/
$cfg['upload_path'] = 'adverts/';

I'm not sure what to do on this part??


Any help would be appreciated

Thanks

Julie............


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Jan 26, 2006 7:56 am
by MikeCXT
I'm not an expert, so the rest will have to be answered by someone else, but you should store your password information above the root directory so that no one can view it through the web. Then you just include_once() it into your page so php can use it.

See viewtopic.php?t=42704&highlight=include+path

This is a security measure. Hope it helps.

Edit: This also lets you change on file, the one above the root, and it will reflect in every single page you use it. As opposed to using your above script in each page that accesses the database, and then should you ever need to change it, having to change every page.