php 檔案安裝方法

來源:互聯網
上載者:User

require_once('inc.php');
if(!file_exists($l_file)){
 echo getstop();
 if(!file_exists($c_file)){
  if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['hostname']!='' && $_POST['database']!='' && $_POST['username']!=''){
   if(@mysql_connect($_POST['hostname'], $_POST['username'], $_POST['password'])){
    if(mysql_select_db($_POST['database']) || mysql_query('CREATE DATABASE '.$_POST['database'])){
     $c_content="<?phpn$hostname_conn='".$_POST['hostname']."';n$database_conn='".$_POST['database']."';n$username_conn='".$_POST['username']."';n$password_conn='".$_POST['password']."';n$dbprefix='".$_POST['dbprefix']."';n$conn=mysql_connect($hostname_conn, $username_conn, $password_conn) or die('');nmysql_select_db($database_conn, $conn);".(chksqlv()?"nmysql_query("SET NAMES 'gb2312'", $conn);n$charset_conn=1;":'')."n?>";
     writeText($c_file,$c_content);
    }else{
     $e=1;
    }
   }else{
    $e=2;
   }
   echo '<script type="text/JavaScript">'.(isset($e)?'location.href='?e='.$e:'location.href='mysql.php').'';</script>';
  }else{
   if(isset($_GET['e']))$msg=$_GET['e']==2?'無法串連資料庫!':'無法建立資料庫!';
   if(isset($msg))echo '<div class="msg_v">'.$msg.'</div>';
?>
 <div class="title">第1步:配置MySQL</div>
 <div class="lcontent">
  <form method="post" onsubmit="if(document.form1.hostname.value=='' || document.form1.database.value=='' || document.form1.username.value==''){alert('請輸入主機名稱、資料庫名、使用者名稱。');return false;}" name="form1">
   <div class="formline"><label for="formhostname">主機名稱:</label><input name="hostname" id="formhostname" size="32" value="localhost"/></div>
   <div class="formline"><label for="formdatabase">資料庫名:</label><input name="database" id="formdatabase" size="32"/></div>
   <div class="formline"><label for="formusername">使用者名稱:</label><input name="username" id="formusername" size="32" value="root"/></div>
   <div class="formline"><label for="formpassword">密碼:</label><input name="password" id="formpassword" size="32"/></div>
   <div class="formline"><label for="formdbprefix">表首碼:</label><input name="dbprefix" id="formdbprefix" size="32" value="alu_"/></div>
   <div class="formline"><input type="submit" value="下一步" id="formsubmit" class="button" /> <input type="reset" value="重設" class="button" /></div>
  </form>
 </div>
<?php
  }
 }else{
  echo '<div class="gcontent">要安裝'.$app_n.',請先刪除“'.$b_file.'”。</div>';
 }
 echo getsfoot();
}else{
 header('Location:../');

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.