我有这个表格:
<form action="index.php?type=add_lesson&type=add" method="post">
<?php echo $lesson_title; ?><br/><input type="text" name="title" style="width:450px;" /><br/>
<?php echo $lesson_url; ?><br/><input type="text" name="url" style="width:450px;" /><br/>
<?php echo $keywords; ?><br/><input type="text" name="kewyords" style="width:450px;" />
<br/><br/><br/>
<input type="submit" value="<?php echo $submit;?>" class="button" /></form>下面是这个index.php代码:
if($_GET['type'] == "add_lesson"){
include_once(fls."add_lesson.php");
}下面是这个add_lesson.php代码:
if($_GET['type'] == 'add'){
$title = htmlspecialchars($_POST['title']);
$url = htmlspecialchars($_POST['url']);
$kewyords = htmlspecialchars($_POST['kewyords']);
$sql = $mysqli->query("INSERT INTO LESSONS(L_TITLE,L_URL,L_COMMENTS,L_VIEWS,L_KEYWORDS)
VALUES('".$title."','".$url."','0','0','".$kewords."') ");
echo $added_sucessfully;
}但是,当我单击提交时,我会看到白色页面
有什么问题吗??
发布于 2013-02-11 00:57:31
您的代码中有错误: include_once(fls."add_lesson.php");可能您遇到了include_once($fls."add_lesson.php");
还要确保你的php安装显示了php错误。可能你有致命的PHP错误没有显示。
下面是一个简单的教程,可以确保你看到php错误:http://www.wallpaperama.com/forums/how-to-display-php-errors-in-my-script-code-when-display-errors-is-disabled-t453.html
还有一件事..你有
<form action="index.php?type=add_lesson&type=add" method="post">
所以在PHP中你只能得到type=add :)
https://stackoverflow.com/questions/14800110
复制相似问题