|
最近做了一個簡單的頁面~
需要讓人填寫好資料後送出~
目前遇到的問題是~在"伺服器行為面板"選擇"插入紀錄"~然後在"插入紀錄"面板最下方有選擇了"插入後即前往"
我把插入後前往的網頁也設定過了~(送出資料的頁面和插入後前往的頁面是同資料夾)
但是他卻出現
Warning: Cannot modify header information - headers already sent in C:\dwphp\AppServ\www\webbuy\umenber.php on line 52
之後我插入書中範本第八章的會員管理系統~他也是跑出一樣的訊息~ PS:網頁瀏覽的出來~但是在最上面會顯示這些訊息~並且輸入資料後會沒辦法前往設定的網頁~然後才顯示這些訊息的~~再麻煩各位幫我解答>"<~~拜託~~拜託~
~~以下是語法的部份~~ <?php virtual('/Connections/webbuy.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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 menber (m_yname, m_name, m_birthday, m_mail, m_phome, m_homephome, m_add, m_passwd) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['yname'], "text"), GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['birthday'], "text"), GetSQLValueString($_POST['mail'], "text"), GetSQLValueString($_POST['phome'], "text"), GetSQLValueString($_POST['homephome'], "text"), GetSQLValueString($_POST['add'], "text"), GetSQLValueString($_POST['passwd'], "text"));
mysql_select_db($database_webbuy, $webbuy); $Result1 = mysql_query($insertSQL, $webbuy) or die(mysql_error());
$insertGoTo = "/webbuy/u1successful.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); }
mysql_select_db($database_webbuy, $webbuy); $query_Recordset1 = "SELECT * FROM menber ORDER BY m_id ASC"; $Recordset1 = mysql_query($query_Recordset1, $webbuy) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?>
|