Location: PHPKode > projects > WESPA PHP Newsletter > install/install3.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>WESPA PHP Newsletter Installer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="web site" />
<meta name="Description" content="new site" />
<meta name="author" content="elfin" />
<meta name="copyright" content="Copyright 2008 WESPA Digital. All rights reserved." />
<link href="css/install.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>WESPA PHP Newsletter</h1>
<p>Manage your mailing lists easily.</p>
<?php
// Rem this if your server admin has register_globals turned on.
// It just converts global variables into local variables
foreach($HTTP_POST_VARS as $postvar => $postval){ ${$postvar} = $postval; }
foreach($HTTP_GET_VARS as $getvar => $getval){ ${$getvar} = $getval; }

if( $cmysql == "yes")
{
 $link = mysql_connect( $cdbhostname, $cdbusername, $cdbpassword );
 if ( ! $link )
 die( "Couldn't connect to MySQL . Please go back and check settings " );
 mysql_select_db( $cdbname, $link )
 or die ( "Couldn't open $cdbname: ".mysql_error() .". Please go back and check settings ");
 $query = "create table maillist(email VARCHAR(50) , date VARCHAR(15) , ip VARCHAR(15) )";
$result = mysql_query( $query );
 if ( ! $result )
 die ("Couldn't create table  ".mysql_error() .". Please go back and check settings ");
}

$fp=fopen("../global1.php","w");
$out=sprintf("<?php \r\n\$main_dir = \"%s\";\r\n",$cpath);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$website = \"%s\";\r\n",$cwebsite);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$relative_string=\"%s\";\r\n",$cstring);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$database_file=\"%s\";\r\n","email.txt");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$popup=\"%s\";\r\n","no");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$lang=\"%s\";\r\n","lang_english.php");
		fwrite($fp,$out,strlen($out));
$out=sprintf("?>");
		fwrite($fp,$out,strlen($out));
		fclose($fp);
		

$fp=fopen("../global3.php","w");

$out=sprintf("<?php \r\n\$email_name=\"%s\";\r\n","Yourname");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_email=\"%s\";\r\n",$cemail);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_thank_title=\"%s\";\r\n","Thank you for registration");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_thank_message=\"%s\";\r\n","Thank you for registration at YOURNAME for the NEWSletter for updates and announcements.");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_unsubscribe_message=\"%s\";\r\n","To unsubscribe: {ulink}link{/ulink} !");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_verify_message=\"%s\";\r\n","Please click on this link to verify your email {slink}subscription{/slink} !");
		fwrite($fp,$out,strlen($out));
//                $out=sprintf("\$email_html=\"%s\";\r\n",$nemail_html);
//				fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_unsubscribe=\"%s\";\r\n","yes");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_thank=\"%s\";\r\n","no");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$email_verify=\"%s\";\r\n","no");
		fwrite($fp,$out,strlen($out));
$out=sprintf("?>");
		fwrite($fp,$out,strlen($out));
		fclose($fp);
		
		

$fp=fopen("../global4.php","w");
$out=sprintf("<?php \r\n\$user=\"%s\";\r\n",$cusername);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$pass=\"%s\";\r\n",$cpassword);
		fwrite($fp,$out,strlen($out));
$out=sprintf("?>");
		fwrite($fp,$out,strlen($out));
		fclose($fp);
		

$fp=fopen("../global2.php","w");
$out=sprintf("<?php \r\n\$mysql=\"%s\";\r\n",$cmysql);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$dbhostname=\"%s\";\r\n",$cdbhostname);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$dbusername=\"%s\";\r\n",$cdbusername);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$dbpassword=\"%s\";\r\n",$cdbpassword);
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$dbname=\"%s\";\r\n",$cdbname);
		fwrite($fp,$out,strlen($out));
$out=sprintf("?>");
		fwrite($fp,$out,strlen($out));
		fclose($fp);


$fp=fopen("../global5.php","w");
		/*output the server selection */
$out=sprintf("<?php \r\n\$mserver=\"%s\";\r\n","php");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$sendmail_string=\"%s\";\r\n","");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$smtp_string=\"%s\";\r\n","");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$smtp_auth=\"%s\";\r\n","no");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$smtp_username=\"%s\";\r\n","");
		fwrite($fp,$out,strlen($out));
$out=sprintf("\$smtp_password=\"%s\";\r\n","");
		fwrite($fp,$out,strlen($out));

$out=sprintf("?>");
		fwrite($fp,$out,strlen($out));
		fclose($fp);


 ?>
<h2>globals.php</h2>
<p>This
is the main config file in case you need to edit something
you can also edit the settings directly using this file.</p>
<p>Writing configuration file 
<span class="success">Successful</span></p>
<h2>Support
and bugs </h2>
<p>Please
visit us if you have any questions or queries also if you
find any bugs report them to us and we will take appropiate
action . If you have any great ideas or suggestions please
let us know .</p>
<ul>
<li>Main website: <a href="htttp://www.wespadigital.com" class="slink">WESPA Digital</a></li>
</ul>

<h2>Please delete install folder</h2>
<p>Please
delete the install folder afer you have completed your installation
because this might lead to security risks and malaciuos activities. </p>
<div class="next"><a href="../admin.php" class="menulink">Goto
the admin page</a></div>

</body>
</html>
Return current item: WESPA PHP Newsletter