我正在尝试连接此代码,但我无法正确执行
echo '<input type="text" id="text" name="username"
value=".<?php if(isset($_COOKIE['.'rememberme'.']))
{echo $_COOKIE['.'remember me'.'];}?>."
placeholder="Username"/><br />';
答案 0 :(得分:3)
你已经在PHP那里了......
<?php
echo '<input type="text" id="text" name="username"';
if( isset($_COOKIE['rememberme'])) echo ' value="'.htmlspecialchars($_COOKIE['rememberme']).'"';
echo ' placeholder="Username" /><br />';
答案 1 :(得分:0)
printf('<input type="text" id="text" name="username" value="%s" placeholder="Username"/><br />',
(isset($_COOKIE['remember_me'])) ? htmlspecialchars($_COOKIE['remember_me']) : ''
);