Просмотр файла v0.01a/install.php

Размер файла: 3.03Kb
<?
require("config.php");

print "<font face=verdana, arial size=2>";
print "<b>Installation starting...</b><br><br>";

$link = mysql_pconnect($db_server, $db_user, $db_pass)
        or print "Could not connect!";

print "<b>Creating Database \"$db_name\"... </b><br>";
mysql_create_db($db_name) or print mysql_error();

mysql_select_db($db_name, $link) or print mysql_error();

print "<br><br><b>Creating Tables...</b><br>";

$result = mysql_query("CREATE TABLE alive (uin varchar(15) NOT NULL default '',  lifesign bigint(14) default NULL) TYPE=MyISAM") or print " Could not create TABLE1! (" . mysql_error() . ")<br>";

$result = mysql_query("CREATE TABLE contactlist (id int(11) NOT NULL auto_increment,  uin varchar(15) NOT NULL default '',  cnick varchar(15) NOT NULL default '',  cuin varchar(15) NOT NULL default '',  PRIMARY KEY  (id)) TYPE=MyISAM") or print " Could not create TABLE2! (" . mysql_error() . ")<br>";

$result = mysql_query("CREATE TABLE cookies (uin varchar(15) NOT NULL default '',  cookie text NOT NULL,  ip varchar(15) NOT NULL default '',  port varchar(5) NOT NULL default '') TYPE=MyISAM") or print " Could not create TABLE3! (" . mysql_error() . ")<br>";

$result = mysql_query("CREATE TABLE incoming (id int(11) NOT NULL auto_increment,  fromuin varchar(15) NOT NULL default '',  touin varchar(15) NOT NULL default '',  msg text NOT NULL,  msgtime datetime default NULL,  online tinyint(4) NOT NULL default '0',  seen tinyint(4) NOT NULL default '0',  KEY id (id)) TYPE=MyISAM") or print " Could not create TABLE4! (" . mysql_error() . ")<br>";

$result = mysql_query("CREATE TABLE outgoing (id int(11) NOT NULL auto_increment,  fromuin varchar(15) NOT NULL default '',  touin varchar(15) NOT NULL default '',  msg text NOT NULL,  msgtime datetime default NULL,  seen tinyint(4) NOT NULL default '0',  PRIMARY KEY  (id)) TYPE=MyISAM") or print " Could not create TABLE5! (" . mysql_error() . ")<br>";

$result = mysql_query("CREATE TABLE uinstatus (uin varchar(15) NOT NULL default '',  statusstr text NOT NULL) TYPE=MyISAM") or print " Could not create TABLE6! (" . mysql_error() . ")<br>";


print "<br><b>Copying BackGround run file...</b><br>";

if (!copy($SCRIPT_PATH."/bgrun.exe", $php_cli_home."bgrun.exe")) 
	{
    print ("failed to copy $file...<br>\n");
	}

print "<br><h2>Installation complete!</h2><br>";
print "Wapmess should now be working at the WAP-adress:<br></font><pre><b>".$wwwpath."/index.php?u=[ICQ USER ID]&p=[ICQ USER PASSWORD]</b></pre> (or ".$wwwpath."/?u=[ICQ USER ID]&p=[ICQ USER PASSWORD] if you have configured your webserver to use index.php as your default startpage)<br>";
print "([ICQ USER ID] should be replaced by your ICQ Uin and [ICQ USER PASSWORD] by your ICQ Password)";

print "You can test this address with any WAP-browser (such as <a target='_blank' href='http://www.opera.com'>Opera</a>, WinWap etc.)";

?>
<center>
<br>
<a target="_blank" target="_blank" href="http://sourceforge.net/projects/wapmess/"><img border="0" src="http://195.100.50.251/wapmess1.gif"></a>
</center>