Php script downloaded what now?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smartmove
Forum Newbie
Posts: 1
Joined: Thu Jan 26, 2006 6:33 am

Php script downloaded what now?

Post 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]
MikeCXT
Forum Newbie
Posts: 14
Joined: Fri Jan 13, 2006 1:26 pm

Post 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.
Post Reply