fieldset和表单HTML

时间:2014-04-27 21:39:06

标签: php html fieldset

我在这里遇到了奇怪的问题。我在html中使用它将它发送到我的脚本.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>

它没有标签,所以我不知道为什么它现在不工作,任何想法?我也会在这里给你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.

正如我所说 - 在我使用fieldsets之前它正在工作。

1 个答案:

答案 0 :(得分:0)

这是您的PHP脚本所在的页面吗? http://sute.com/rp.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>