相同的程式碼在windows7可以程現,但在centos 5.5 卻無法呈現

請問各位大大,如討論主題,我應如何可以在centos呈現網頁 ? 謝謝

評論

  • 沒看到程式碼,但大多是路徑問題造成吧?
  • edited 十二月 2017
    附上程式碼,前段,謝謝大大
    <?php require_once('Connections/memberConn.php'); ?>
    <?php
    mysql_query("SET NAMES 'UTF8'");
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO memberdata (memId, memPsw, memName, memEmail, memPId, memBirthday, memSex, memTel, memAddress) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['memId'], "text"),
                           //GetSQLValueString($_POST['pass1'], "text"),
    					   GetSQLValueString(md5($_POST['pass1']), "text"),
    					   
                           GetSQLValueString($_POST['memName'], "text"),
                           GetSQLValueString($_POST['memEmail'], "text"),
                           GetSQLValueString($_POST['memPId'], "text"),
                           GetSQLValueString($_POST['memBirthday'], "date"),
                           GetSQLValueString($_POST['memSex'], "text"),
                           GetSQLValueString($_POST['memTel'], "text"),
                           GetSQLValueString($_POST['memAddress'], "text"));
    
      mysql_select_db($database_memberConn, $memberConn);
      $Result1 = mysql_query($insertSQL, $memberConn) or die(mysql_error());
    
      $insertGoTo = "addok.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;
    <html xmlns="http://www.w3.org/1999/xhtml">;
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>會員專區-加入會員</title>
    <style type="text/css">
    <!--
    .style2 {color: #FFFFFF}
    .style4 {font-size: 10pt}
    .style6 {color: #FF0000}
    -->
    </style>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    
    <script language="javascript">
    function chkpas(pas_2){
    	if(document.getElementById("pass1").value==pas_2){
    		return true;
    	}else{
    		return false;
    	}
    }
    </script>
    
    <script language="javascript">
    <!--
    function chkUserID(idObj){
    	if(idObj.value.length < 4){
    		/*當使用者輸入的帳號長度小於4個字元
    		則顯示錯誤提示*/
    		document.getElementById("idErrMsg").innerHTML = "<img src='img/info.gif' /><font color='red'> 帳號長度不得小於4個字元</font>";
    	}else{
    		/*否則,以GET方式呼叫執行chkID.phpt程式
    		並傳遞使用者所輸入的帳號進行驗證*/
    		Spry.Utils.loadURL("GET","chkID.php?newID=" + idObj.value,false,chkIdRes);
    	}
    }
    
    function chkIdRes(IDreq){
    	var IDresult = IDreq.xhRequest.responseText;
    	if(IDresult!=0){
    //已有相同的帳號存在
    		document.getElementById("idErrMsg").innerHTML = "<img src='img/block1.gif' /><font color='red'> 此帳號已被使用!!</font>";
    	}else{
    //未發現相同的帳號
    		document.getElementById("idErrMsg").innerHTML = "<img src='img/apply2.gif' /><font color='green'> 恭喜,此帳號可註冊使用!</font>";
    	}
    }
    
    -->
    </script>
    
    </head>
    
  • edited 十二月 2017
    附上後半段程式碼
    <body>
    <table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td width="18"><img src="img/he3_6.gif" width="18" height="19" /></td>
        <td width="714" background="img/he3_7.gif">&nbsp;</td>
        <td width="18"><img src="img/he3_8.gif" width="18" height="19" /></td>
      </tr>
      <tr>
        <td background="img/he3_4.gif">&nbsp;</td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><a href="index.php"><a href="login.php"></a><a href="addmem.php"><img src="img/add.gif" alt="加入會員" width="171" height="50" border="0" /></a></td>
            </tr>
        </table></td>
        <td background="img/he3_5.gif">&nbsp;</td>
      </tr>
      <tr>
        <td><img src="img/he3_1.gif" width="18" height="30" /></td>
        <td background="img/he3_2.gif">&nbsp;</td>
        <td background="img/he3_3.gif">&nbsp;</td>
      </tr>
      <tr>
        <td background="img/he3_4.gif">&nbsp;</td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="center"><br />
                <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
                  <table width="650" border="0" cellspacing="0" cellpadding="5">
              <tr class="m08"> 
                <td width="150" align="right"><span class="style4">帳  號:</span></td>
                <td align="left" class="style4"><input name="memId" type="text" size="25" maxlength="30" onBlur="chkUserID(this);"><span id="idErrMsg"> </span></td>
              </tr>
              <tr class="m08"> 
                <td align="right"><span class="style4">密  碼:</span></td>
                <td align="left" class="style4"><span id="sprytextfield8">
                  <input name="pass1" id="pass1" type="password" size="25" maxlength="30" />
                  <span class="textfieldRequiredMsg">請輸入密碼。</span></span></td>
              </tr>
              <tr class="m08"> 
                <td align="right"><span class="style4">確認密碼:</span></td>
                <td align="left" class="style4"><span id="sprytextfield7">
                <input name="pass2" type="password" size="25" maxlength="30" />
                <span class="textfieldRequiredMsg">請再次輸入密碼作為確認。</span><span class="textfieldInvalidFormatMsg">兩次輸入密碼必須相同。</span></span></td>
              </tr>
              <tr class="m08">
                <td width="150" align="right"><span class="style4">姓  名:</span></td>
                <td align="left" class="style4"><span class="style4"><span id="sprytextfield4">
                  <input name="memName" type="text" size="25" maxlength="40" id="memName" />
                  <span class="textfieldRequiredMsg">請輸入姓名。</span></span>
                    <input name="memSex" type="radio" value="m" checked>
                  先生 
                  <input name="memSex" type="radio" value="f">
                  小姐 </span></td>
              </tr>
              <tr class="m08"> 
                <td align="right"><span class="style4">生  日:</span></td>
                <td align="left" class="style4"><span id="sprytextfield3">
                <label>
                  <input name="memBirthday" type="text" id="memBirthday" size="25" maxlength="10" />
                  <font color="red">*</font><span class="style6">yyyy/mm/dd</span></label>
                <span class="textfieldRequiredMsg">請輸入生日。</span><span class="textfieldInvalidFormatMsg">請輸入正確格式的生日。</span></span></td>
              </tr>
              <tr class="m08"> 
                <td align="right"><span class="style4">身分證字號:</span></td>
                <td align="left" class="style4"><span id="sprytextfield2">
                <input name="memPId" type="text" id="memPId" size="25" maxlength="15" />
                <span class="textfieldRequiredMsg">請輸入身分證字號。</span></span></td>
              </tr>
    <tr class="m08"><td align="right"><span class="style4">居住地址:</span></td><td align="left" class="style4"><span class="style4"><span id="sprytextfield5">
      <input name="memAddress" type="text" size="35" value="" id="memAddress" />
      <span class="textfieldRequiredMsg">請輸入住址。</span></span><font color=red>* 請勿填寫郵政信箱</font></span></td>
    </tr>
              <tr class="m08"> 
                <td align="right"><span class="style4">電子郵件:</span></td>
                <td align="left" class="style4"><span id="sprytextfield1">
                <input name="memEmail" type="text" size="25" maxlength="100" id="memEmail" />
                <span class="textfieldRequiredMsg">請輸入電子郵件。</span><span class="textfieldInvalidFormatMsg">請正確填寫Email。</span></span></td>
              </tr>
              <tr class="m08"> 
                <td align="right"><span class="style4">聯絡電話:</span></td>
                <td align="left" class="style4"><span id="sprytextfield6">
                  <input name="memTel" type="text" id="memTel" size="25" maxlength="50" />
                  <span class="textfieldRequiredMsg">請輸入電話。</span></span></td>
              </tr>
            </table>
                  <input type="submit" name="submit" id="submit" value="加入會員" />
                  <input type="hidden" name="MM_insert" value="form1" />
                </form>
              </td>
            </tr>
        </table></td>
        <td background="img/he3_5.gif">&nbsp;</td>
      </tr>
      <tr>
        <td><img src="img/he3_1.gif" alt="" width="18" height="30" /></td>
        <td background="img/he3_2.gif">&nbsp;</td>
        <td background="img/he3_3.gif">&nbsp;</td>
      </tr>
    </table>
    <table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr align="center">
        <td><a href="index.php"><img src="img/title.gif" alt="會員專區" width="198" height="52" border="0" /></a></td>
        <td><a href="login.php"><img src="img/login.gif" alt="會員登入" width="171" height="50" border="0" /></a></td>
        <td><a href="mempsw.php"><img src="img/psw.gif" alt="會員密碼查詢" width="171" height="50" border="0" /></a></td>
        <td><a href="memedit.php"><img src="img/edit.gif" alt="修改會員資料" width="171" height="50" border="0" /></a></td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <script type="text/javascript">
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "email");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "date", {format:"yyyy/mm/dd"});
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
    var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "custom", {validation:chkpas, validateOn:["blur"]});
    var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8");
    //-->
    </script>
    </body>
    </html>
    
  • 檢查一下網站的錯誤記錄檔,看看有沒有提示哪裡出錯
  • 大大,你好,我也不知錯誤記錄檔的檔名是 ? 因我原架xoops,但剛傳的程式是另外用的,會不會是xoops不接受另外寫的程式碼,非得使用xoops的模組 ? 謝謝
  • 錯誤記錄檔是網頁伺服器的, CentOS 應該是 /var/log/httpd/error_log
Sign In or Register to comment.