中發表聲明,我已經看過很多有這樣問題的帖子,但是我找不到正確的答案。 問題是我有一個代碼,說如果...爲空,使變量...(見下面的代碼)。 這個變量是一種形式,在這種形式中,你有像名稱,消息等東西。我想要的是名稱的佔位符,如果用戶登錄是他的名字,它保存在我的數據庫中。這是代碼:如果在變量
$action = isset($_POST["action"]) ? $_POST["action"] : "";
if (empty($action)) {
// Send back the contact form HTML
$output = "<div style='display:none'>
<div class='contact-top'></div>
<div class='contact-content'>
<h1 class='contact-title'>Stuur een bericht voor hulp:</h1>
<div class='contact-loading' style='display:none'></div>
<div class='contact-message' style='display:none'></div>
<br><br><form action='#' style='display:none'>
<input type='text' id='contact-name' class='contact-input' name='name' tabindex='1001' placeholder='Naam*' /><br><br>
<input type='text' id='contact-email' class='contact-input' name='email' tabindex='1002' placeholder='Email*' /><br><br>";
這也是我想要什麼,但什麼行不通:
<input type='text' id='contact-name' class='contact-input' name='name' tabindex='1001' placeholder=', " if (logged_in() === true) {echo $user_data["name"] } else { echo 'Naam'; } " ,' /><br><br>
希望有人能幫助,在此先感謝,
保羅
(naam =用我的語言寫的名字)
您shoule加上''在您輸入 – lighter
@LLL我覺得他相當努力去做包含字符串的HTML裏面,而不是模板。 – baldrs