HTML页面中的PHP变量
我可以向HTML页面添加变量吗 例如: 我有这个:HTML页面中的PHP变量,php,html,variables,post,Php,Html,Variables,Post,我可以向HTML页面添加变量吗 例如: 我有这个: <form action="[FORUM_LOGIN_URL/]" enctype="application/x-www-form-urlencoded" id="loginForm" method="post" name="loginForm" onsubmit="return handleLogin();"> <div id="loginFormContainer"> <input id="logi
<form action="[FORUM_LOGIN_URL/]" enctype="application/x-www-form-urlencoded" id="loginForm" method="post" name="loginForm" onsubmit="return handleLogin();">
<div id="loginFormContainer">
<input id="loginField" name="login" type="hidden" value="login">
<input id="redirectField" name="redirect" type="hidden" value="[REDIRECT_URL/]">
<div>
<label for="userNameField">[LANG]userName[/LANG]:</label><br>
<input id="userNameField" maxlength="[USER_NAME_MAX_LENGTH/]" name="username" readonly="readonly" type="text" value="Liel">
</div>
<div>
<label for="passwordField">אין צורך בסיסמה:</label><br>
<input id="passwordField" name="password" readonly="readonly" type="password">
</div>
<div>
<label for="languageSelection">[LANG]language[/LANG]:</label><br>
<select id="languageSelection" name="lang" onchange="ajaxChat.switchLanguage(this.value);">
</select>
</div>
<div>
<input id="loginButton" name="submit" type="submit" value="[LANG]login[/LANG]">
</div>
</div>
</form>
您可以简单地在带有php标记的html中添加php代码。比如说
<?php echo $something; ?>
在此之前,您需要确保,您的文件必须另存为.php扩展名。我认为没有其他方法可以摘录使用AJAX或模板引擎的内容。谢谢,我可以在Lang.php中添加变量?它的php,但有,我不能添加我的变量到它。
$lang['langexample'] = 'variable';
<?php echo $something; ?>