Php 字段集和表单HTML

Php 字段集和表单HTML,php,html,fieldset,Php,Html,Fieldset,我这里有个奇怪的问题。我用html将它发送到script.php。一切都很好,脚本正常运行。没有页边空白看起来有点难看,所以我试着编辑一下。我找到了一种方法,对CSS进行了一些更改,并使用了。现在它坏了。我真的不知道为什么 以下是HTML代码: 表格前: [insert_php] $current_user = wp_get_current_user(); [/insert_php] 后形式 <form action="http://sute.com/rp.php" method="

我这里有个奇怪的问题。我用html将它发送到script.php。一切都很好,脚本正常运行。没有页边空白看起来有点难看,所以我试着编辑一下。我找到了一种方法,对CSS进行了一些更改,并使用了。现在它坏了。我真的不知道为什么

以下是HTML代码: 表格前:

[insert_php]
$current_user = wp_get_current_user();

[/insert_php]
后形式

 <form action="http://sute.com/rp.php" method="post">
    <fieldset><label for="email">Email:</label><input name="email" size="20" type="text" />
    <label for="user_name">Nick:</label><input name="user_name" size="20" type="text" />
    <label for="server">Server:</label><select name="server">    
    <option value="1">1</option>         
    <option value="2">2</option>         
    <option value="3">3</option></select></fieldset>
    <input type="hidden" name="reward" value="123">
    <input type="hidden" name="user_id" value="[insert_php]echo "$current_user->ID";[/insert_php]">
    <center><input type="submit" value="Submit" /></center></form>

电邮:
尼克:
服务器:
1.
2.
3.
ID“;[/insert_php]”
它在没有标签的情况下工作,所以我不知道为什么它现在不工作,知道吗?我还将在这里为您提供PHP代码

$user_id = mysql_real_escape_string($_POST['user_id']);
$user_name = mysql_real_escape_string($_POST['user_name']);
$server = mysql_real_escape_string($_POST['server']);
$email = mysql_real_escape_string($_POST['email']);
$nagroda = mysql_real_escape_string($_POST['reward']);
$price = mysql_real_escape_string($_POST['price']);
echo "<body style='background: url(http://bg.com/bg.jpg) no-repeat fixed center center;'>";
echo "<background-repeat: no-repeat;>";

$pkt = mysql_query("SELECT meta_value FROM wp_usermeta WHERE user_id = $user_id AND meta_key='mycred_default'");
if ( $pkt > 0 OR $user_id == 0) {

 $message = 'Sorry, you need more LPoints.';

    echo "<SCRIPT type='text/javascript'> //not showing me this
        alert('$message');
        window.location.replace((\"http://sute.com\"));
    </SCRIPT>";
    mysql_close();
}
rest of the code, doesn't really matter because it ends here with my problem.
$user\u id=mysql\u real\u escape\u字符串($\u POST['user\u id']);
$user\u name=mysql\u real\u escape\u字符串($\u POST['user\u name']);
$server=mysql\u real\u escape\u字符串($\u POST['server']);
$email=mysql\u real\u escape\u字符串($\u POST['email']);
$nagroda=mysql\u real\u escape\u字符串($\u POST['raward']);
$price=mysql\u real\u escape\u字符串($\u POST['price']);
回声“;
回声“;
$pkt=mysql_query(“从wp_usermeta中选择meta_值,其中user_id=$user_id和meta_key='mycred_default'”);
如果($pkt>0或$user\u id==0){
$message='对不起,您需要更多的LPoints';
echo//不给我看这个
警报(“$message”);
window.location.replace((\)http://sute.com\"));
";
mysql_close();
}
代码的其余部分并不重要,因为它以我的问题结束。

正如我所说的,在我使用字段集之前,它是有效的。

这是您的php脚本所在的页面吗?


电邮:
尼克:
服务器:
1.
2.
3.
ID“;[/insert_php]”

奇怪。最初就像你说的那样。首先关闭,然后选择字段集。我不知道为什么在我的帖子中会出现第一个结束字段集。仍然不起作用。更多的想法?谢谢你的努力。我已经改变了它,以确保没有人会认为它就像你说的:)无所谓。我只是愚蠢。我忘了我在php$pkt>0中设置了$pkt<0。
<form action="http://sute.com/rp.php" method="post">
    <fieldset>
        <label for="email">Email:</label><input name="email" size="20" type="text" />
        <label for="user_name">Nick:</label><input name="user_name" size="20" type="text" />
        <label for="server">Server:</label>
        <select name="server">    
            <option value="1">1</option>         
            <option value="2">2</option>         
            <option value="3">3</option>
        </select>
    </fieldset>
    <input type="hidden" name="reward" value="123"> 
    <input type="hidden" name="user_id" value="[insert_php]echo "$current_user->ID";[/insert_php]">
    <center><input type="submit" value="Submit" /></center>
</form>