This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Import a MS SQL T-SQL dump file into | |
* and ODBC connection via a PHP browser | |
* script. | |
* | |
* I have not tested the script with binary DB fields so | |
* I cannot confirm whether it works or not. | |
* | |
* @author Simon Holywell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp_addumpdevice 'disk', 'pseudoName', 'C:yourFilename.mdb'; | |
GO | |
DUMP DATABASE yourDatabaseName TO pseudoName; | |
GO | |
sp_dropdevice pseudoName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Get ISO list of countries | |
$iso_xml_zip_file_url = 'http://www.iso.org/iso/'; | |
$iso_xml_zip_filename = 'iso_3166-1_list_en.zip'; | |
$iso_xml_zip_new_filename = 'iso_3166-1_list_en_'.date('Y-m-d').'.zip'; | |
$iso_xml_filename = 'iso_3166-1_list_en.xml'; | |
$download_directory = './temp/'; | |
//setup database variables | |
$table_name = 'countries'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Original script written by | |
Simon Holywell (simonholywell.com) | |
17/3/2006 | |
You may use this script for any purpose. You can | |
make changes to the code. You may NOT redistribute | |
the code, link back to my site. All derivatives | |
must be released and opensource. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('ADODB_SESSION')) die(); | |
include_once ADODB_SESSION . '/crypt.inc.php'; | |
class ADODB_Encrypt_SHA1 { | |
function write($data, $key) { | |
$sha1crypt =& new SHA1Crypt(); | |
return $sha1crypt->encrypt($data, $key); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SHA1Crypt{ | |
function keyED($txt,$encrypt_key) | |
{ | |
$encrypt_key = sha1($encrypt_key); | |
$ctr=0; | |
$tmp = ""; | |
for ($i=0;$i<strlen($txt);$i++){ | |
if ($ctr==strlen($encrypt_key)) $ctr=0; | |
$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXEC master.dbo.sp_addlinkedserver @server = N'MYSQL', @srvproduct=N'MySQL', @provider=N'MSDASQL', @provstr=N'DRIVER={MySQL ODBC 3.51 Driver}; SERVER=MySQLServerIP; DATABASE=Db_NAME; USER=MySQLUserName; PASSWORD=MySQLPassword; OPTION=3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$conn = mysql_connect('host','user','pass'); | |
mysql_select_db('database',$conn); | |
$SQL = "SHOW TABLES;"; | |
$result = mysql_query($SQL, $conn); | |
while($row = mysql_fetch_array($result)) | |
print "SELECT * INTO SQLServerDBName.dbo.{$row[0]}<br /> | |
FROM openquery(MySQL, 'SELECT * FROM `{$row[0]}`');<br /> | |
"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION | |
GO | |
CREATE TABLE dbo.Tmp_admin_accounts | |
( | |
account_id int NOT NULL IDENTITY (1, 1), | |
username varchar(20) NOT NULL, | |
passhash char(40) NOT NULL | |
) ON [PRIMARY] | |
GO | |
SET IDENTITY_INSERT dbo.Tmp_admin_accounts ON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
DocumentRoot c:\xampp\simonholywell.com\pub | |
ServerName simonholywell.localhost | |
<Directory c:\xampp\simonholywell.com\pub> | |
Order allow,deny | |
Allow from all | |
</Directory> | |
</VirtualHost> |
OlderNewer