PHP-Echo-in-Href-Cutting-off变量

PHP-Echo-in-Href-Cutting-off变量,php,href,Php,Href,在我的行动中: <form class="login" style=" ;"method="post" action=<?php echo "add_answer.php?id="; echo $id; echo "&z=$zipcode&d=$date&category=$category"; ?>"> 您需要输入变量 <form class="login" style=" ;"method="post" action=<?

在我的行动中:

    <form class="login" style=" ;"method="post" action=<?php echo "add_answer.php?id="; echo $id; echo "&z=$zipcode&d=$date&category=$category"; ?>">
您需要输入变量

<form class="login" style=" ;"method="post" action=<?php echo "add_answer.php?id=".urlencode($id)."&z=".urlencode($zipcode)."&d=".urlencode($date)."&category=".urlencode($category); ?>">
像这样尝试:

<form class="login" style=" " method="post" action="<?php echo "add_answer.php?id=$id&z=$zipcode&d=$date&category=urlencode($category)"; ?>">
使用此-

form class="login" style=" ;"method="post" action=<?php echo "index2.php?id=".urlencode($id)."&z=".urlencode($zipcode)."&d=".urlencode($date)."&category=".urlencode($category); ?>>
formclass=“login”style=“;”method=“post”action=>

为什么不能用$id做同样的事情?