Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dbConnect()
- {
- global $dbName;
- global $secretKey;
- $link = mysql_connect('..', '..', '..');
- if(!$link)
- {
- fail("Couldn´t connect to database server");
- }
- if(!@mysql_select_db($dbName))
- {
- fail("Couldn´t find database $dbName");
- }
- return $link;
- }
- function safe($variable)
- {
- $variable = addslashes(trim($variable));
- return $variable;
- }
- function fail($errorMsg)
- {
- print $errorMsg;
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement