小编Cha*_*ray的帖子

你如何设置一个多个值的PHP cookie?

我想创建一个存储用户名和用户ID的php cookie.或者只使用一个来获得另一个更好?

php cookies

4
推荐指数
2
解决办法
2万
查看次数

php mysql_fetch_array重置

我想从mysql数据库打印一个列表,但第一个列表项不打印,因为mysql_fetch_array被调用两次.我尝试重置但它没有用.我该怎么办?

$current_goam = mysql_real_escape_string($current_goam);
$current_content = mysql_real_escape_string($current_content);

$note_content = mysql_query("select * from notes where title='$current_content' and goam='$current_goam' and user_id='$user_id'");

$note = mysql_fetch_array( $note_content );

if($note['type'] == 'list')
{
    $note_type='list';      
    reset($note);

    print "<table>";
    while($note_info = mysql_fetch_array( $note_content ))
    {
        print "<tr><td>";
           echo $note_info['body'];
            print "</td>";

            echo "<td><input type='checkbox' name='complete_goal' value='".$note_info['note_id']."'></input></td>";         
         print "</tr>";
    }
    print "</table>";
}   
else{
    echo $note['body'];
}
Run Code Online (Sandbox Code Playgroud)

php mysql

4
推荐指数
1
解决办法
1万
查看次数

mysql插入故障

我无法弄清楚为什么这不起作用.它说"注释已添加"但它实际上并没有将它添加到数据库中.

<?php

    $notetitle = $_POST['title'];
    $notebody = $_POST['body'];

if ($notetitle && $notebody){
mysql_query("insert into notes values
('$user_id', '', '$subject', '$notetitle', '$note_type' '$notebody')");

echo "Note \"" . $notetitle . "\" added.";
}
Run Code Online (Sandbox Code Playgroud)

?>

php mysql

2
推荐指数
1
解决办法
79
查看次数

PHP GET方法空间错误

<?php

$current_subject = $_GET['subject_id'];
$current_content = $_GET['note_id'];

echo "<form method=\"post\" action=mainpage.php?subject_id=".$current_subject."&note_id=".$current_content.">";

?> 
  <input type='text' name='list_item' value=''>
  <input type='submit' name="new_item" value="New Item">   
</form>
Run Code Online (Sandbox Code Playgroud)

问题是,当其中一个GET变量是两个单词时,链接就不会这样写.例如,如果$current_subject="Advanced Chemistry"$current_content="Valence Electrons"链接将出现如下:

<form method=?"post" action=?"mainpage.php?subject_id=Advanced" chemistry&note_id=?"Valence" electrons>?
Run Code Online (Sandbox Code Playgroud)

html php get

1
推荐指数
1
解决办法
2559
查看次数

避免在php页面上重新发送表单

当我刷新php页面时,有没有办法避免重新处理表单?我想在刷新带有插入功能的php文件的链接时阻止重新发送表单.例如,我正在处理用户在每页顶部写的一系列笔记,以获得新笔记.除了明显创建一个带有头功能的单独的php文件之外还有另外一种方法吗?

php

1
推荐指数
1
解决办法
6304
查看次数

标签 统计

php ×5

mysql ×2

cookies ×1

get ×1

html ×1