在PHP中分发文本
在我的名为“account.php”的php文件中在PHP中分发文本,php,Php,在我的名为“account.php”的php文件中 如果您不理解我的问题,请让我知道,我将尝试进一步解释。谢谢。:) 我的建议是使用javascript(或jQuery)对处理文本文件读取的PHP脚本进行AJAX调用,然后删除顶行。然后javascript需要获取脚本的响应(文本文件上的行)并将文本框添加到页面。PHP在发送到浏览器之前经过解析。如果你想通过按钮与用户交互,你需要一个客户端脚本,比如javascript。我已经更新了我的问题,试图让它更容易理解。 <?php // Fir
如果您不理解我的问题,请让我知道,我将尝试进一步解释。谢谢。:) 我的建议是使用javascript(或jQuery)对处理文本文件读取的PHP脚本进行AJAX调用,然后删除顶行。然后javascript需要获取脚本的响应(文本文件上的行)并将文本框添加到页面。PHP在发送到浏览器之前经过解析。如果你想通过按钮与用户交互,你需要一个客户端脚本,比如javascript。我已经更新了我的问题,试图让它更容易理解。
<?php
// First we execute our common code to connection to the database and start the session
require("common.php");
// At the top of the page we check to see whether the user is logged in or not
if(empty($_SESSION['user']))
{
// If they are not, we redirect them to the login page.
header("Location: login.php");
// Remember that this die statement is absolutely critical. Without it,
// people can view your members-only content without logging in.
die("Redirecting to login.php");
}
?>
<html>
<body>
<link rel="icon" type="image/gif" href="favicon.gif" />
<?php include("header.php"); ?>
<div id="main-box">
<ul>
<li class="buttons">
<?php
//TEXT BOX WITH A LINE FROM **TEXT.txt** SHOULD APPEAR HERE AFTER USER CLICKS BUTTONS
?>
<input type="button" name="account" value="Get Your Account" onclick="#" />
</li>
</ul>
</div>
</body>
</html>
Eddie so after the user clicks the button it displays this line to them and then deletes it after so that the next line would then become the first line.
Apples
Hello
People