Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 回信_Php - Fatal编程技术网

Php 回信

Php 回信,php,Php,我有以下代码: <select name="to" class="combo" value=' <?php if(isset($_POST['reply'])) { echo "<option value='$reply'>$reply</option>"; } ?> '

我有以下代码:

<select name="to" class="combo"  value='
            <?php 
            if(isset($_POST['reply'])) 
            { 
                echo "<option value='$reply'>$reply</option>";
            }
            ?>
            ' />
            <?php

            $q = $database->selectAllUsersNotMe();
            while($row=mysql_fetch_assoc($q))
            {
                $u=$row['username'];
                echo "<option value=\"$u\">$u</option>";
            }
            ?>
            </select>
                <? $reply = $_POST['rfrom']; ?>


        <form name='reply' method='post' action='/newmessage.php'>
        <input type='hidden' name='rfrom' value='<?php echo $pm->messages[0]['from']; ?>' />
        <input type='hidden' name='rsubject' value='Re: <?php echo $pm->messages[0]['title']; ?>' />
        <input type='hidden' name='rmessage' value='[quote]<?php echo $pm->messages[0]['message']; ?>[/quote]' />
        <input type='submit' name='reply' value='Reply' />
    </form>

这样做的目的是为我的站点上的所有用户(不包括发送消息的用户)生成一个带有下拉菜单的组合框

我正在尝试向邮件添加回复元素。 单击“答复”时,我使用以下代码:

<select name="to" class="combo"  value='
            <?php 
            if(isset($_POST['reply'])) 
            { 
                echo "<option value='$reply'>$reply</option>";
            }
            ?>
            ' />
            <?php

            $q = $database->selectAllUsersNotMe();
            while($row=mysql_fetch_assoc($q))
            {
                $u=$row['username'];
                echo "<option value=\"$u\">$u</option>";
            }
            ?>
            </select>
                <? $reply = $_POST['rfrom']; ?>


        <form name='reply' method='post' action='/newmessage.php'>
        <input type='hidden' name='rfrom' value='<?php echo $pm->messages[0]['from']; ?>' />
        <input type='hidden' name='rsubject' value='Re: <?php echo $pm->messages[0]['title']; ?>' />
        <input type='hidden' name='rmessage' value='[quote]<?php echo $pm->messages[0]['message']; ?>[/quote]' />
        <input type='submit' name='reply' value='Reply' />
    </form>

$fromname=(isset($\u POST['rfrom']))$_POST['rfrom']:''//应该验证$\u POST
而($row=mysql\u fetch\u assoc($q)){
$u=$row['username'];
$selected=($u==$fromname)?'selected=“selected”:'';
回声“$u”;
}
$replyUser=$\u POST['rfrom'];
while($row=mysql\u fetch\u object($q))
{
如果($row->username==$replyUser)
{
echo('.$row->username');
}否则{
echo('.$row->username');
}
}