首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在数据库中插入数据时没有结果吗?

问在数据库中插入数据时没有结果吗?
EN

Stack Overflow用户
提问于 2013-02-11 00:54:32
回答 1查看 30关注 0票数 0

我有这个表格:

代码语言:javascript
复制
<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代码:

代码语言:javascript
复制
if($_GET['type'] == "add_lesson"){
        include_once(fls."add_lesson.php");
    }

下面是这个add_lesson.php代码:

代码语言:javascript
复制
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;
}

但是,当我单击提交时,我会看到白色页面

有什么问题吗??

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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 :)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14800110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档