ACCES INTERZIS | blog de programare si securitate IT




 22 Feb 2010 @ 15:35 

The bellow PHP script allows you to grab email addresses of a web page.

An important feature of the script is that it can run very well on a local server as EasyPHP or XAMPP. It doesn’t have to run on a hosting server which might has restricted the use of PHP function file_get_contents(). For our records, this resctriction is done editing the php.ini file of the Apache server. More exactly, the following line: allow_url_fopen = Off.

More »

Post to Twitter Tweet This Post

Posted By: admin
Last Edit: 23 Feb 2010 @ 09:36

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: programming
 22 Feb 2010 @ 14:50 

The below PHP script allows you to connect securely to a MySQL database.

<?php
define('SQL_HOST', 'localhost');
define('SQL_USER', 'username');
define('SQL_PASS', 'password');
define('SQL_DB', 'database name');

@mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die('I can`t connect to MySQL server!');
@mysql_select_db(SQL_DB) or die('I can`t connect to database!');
?>

Usually, this script is an include file which is called, mostly above DOCTYPE, whenever a page needs a connection to database.

<?php include("includes/connect_to_db.inc.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Post to Twitter Tweet This Post

Posted By: admin
Last Edit: 22 Feb 2010 @ 15:25

EmailPermalinkComments (0)
Tags
Tags: , ,
Categories: programming