Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML页面中的PHP变量_Php_Html_Variables_Post - Fatal编程技术网

HTML页面中的PHP变量

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

我可以向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="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; ?>