2017-05-23 13 views
0

私は送信アクションの下にコードを持っていますが、この画面の前にはログイン画面があります。だから、現在の 私はフォームの下の "thisuser"入力値に追加したいと思います。現在の値は、あなたがフィールドセット入力のユーザーセッション値

<input type="hidden" name="thisuser" value="<?php echo $_POST['user']; ?>"> 

注意を使用することができます

<!DOCTYPE html> 
<html lang="en"> 
<head> 

<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"> 

<title>untitled document</title> 

<!--<link rel="stylesheet" href="screen.css" media="screen">--> 

<style media="screen"> 
fieldset { 
    display: inline-block; 
} 
input { 
    display: inline-block; 
    margin: 0.25em 0; 
} 
label{ 
    display: inline-block; 
    width: 7em; 
} 
</style> 

</head> 
<body> 

<form action="http://trackit/app-copy/curl_create.php" method="get"> 
    <fieldset> 
    <input type="hidden" name="thisuser" value="TEST+USER"> 
    <label for="summ">Summary:</label> 
    <input type="text" id="summ" name="summ"><br> 
    <label for="comment">Description:</label> 
    <input type="text" id="comment" name="comment"><br> 
    <input type="submit" value="Submit"> 
    </fieldset> 
</form> 

</body> 
</html> 
+1

何を達成したいのですか?私は単語を理解していません。 – DaAmidza

答えて

0

「TEST + USER」である:非常にあなたのコードでそれを渡すためにあなたのデータをフィルタリングし、検証することをお勧めします。 <?php echo (int)$_POST['user']; ?>を使用して、少なくとも値が常に整数であることを確認することができます。

注2:使用POST方法の代わりに、はフォームのためをGET。