当我尝试执行我的代码时,我得到了一个未定义的变量,在mysql中输入了条目,但没有插入数据,显然是因为这个未定义的变量。
它在工作..。
下面是要传达的信息:
PHP Notice: Undefined variable: title in /Applications/MAMP/htdocs/rfx/wp-content/plugins/rfx-manager/inc/rfi_page.php on line 154代码如下:
<?php
$wpdb->query("insert into ".$wpdb->prefix."forms set user_id=".$user_id.",
title='".$title."');
$title=$result->title;
?>
<form method="post" enctype="multipart/form-data" role="form">
<label for="title"><b>Enter title here:</b></label>
<br>
<input type="text" name="title" class="large-text" value="<?php echo (isset($title) ? $title : '') ?>" placeholder="Enter title">
<input class="button-primary" type="submit" name="submit" value="<?php _e( 'Submit RFI for approval' ); ?>" />
</form>发布于 2014-05-24 17:01:29
对不起,伙计们,基本上问题是,其中一个变量当然没有声明。
我给出的代码片段如下:
$title=$result->title;
有更多像这样的变量堆叠在一起,其中一个给出了冲突,我基本上逐一检查了它们,添加了每个变量,并对其进行了测试,问题浮出水面。
希望这对任何人都有帮助。
https://stackoverflow.com/questions/23730697
复制相似问题