好的,就在这里。在php while循环中运行jquery
我有一个index.php页面。它所做的是使HTML页面或运行一个while循环。
它只会在您填写一些信息并按下html页面上的提交按钮后运行循环。现在在底部的html页面上,我说“__操作已经完成”,空白是每次循环运行时都添加了1的变量。
现在我想要发生的是每次循环运行时要更新的数字。我也被告知我们ajax/jquery要做到这一点,但我一直无法弄清楚。
那么我可以在while循环中放置哪些变量来更新?
<?php
$number = $_POST['number'];
if(isset($number)){}
else{
$number = 0;
}
if(isset($_POST['Submit'])){
$MN = $_POST['MN'];
$count = $_POST['count'];
$provider = $_POST['provider'];
for ($i = 0; $i < $count; $i++) {
$m = rand(10e16, 10e20);
$n = base_convert(¤m, 10, 36);
$subject = $m;
$body = $n;
$number = $number + 1;
}
}
echo <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<form action="$PHP_SELF" method="post">
<center> <p>
<label><b><big><big><big><big><big><big><big>Page</big></big></big></big></big></big></big></b></label>
</p>
<p>
<p>
<label><strong><u>MN</u></label>
</p>
<input name="MN" type="text" value=""/>
</p>
<p>
<p>
<label><strong><u>Number to Send</u></label>
</p>
<input name="count" type="text" value = "1"/>
<input name = "number" type = "hidden" value = "$number"/>
</p>
<p>
<p>
<label><strong><u>Provider</u></label>
</p>
<select name="provider">
<option value="">Choose One...</option>
</select>
</p>
<p>
<input name = "Submit" type = "submit" value = "Send"></a>
</p>
<p>You have done {$number} actions</p>
</center>
</body></html>
</style>
</head>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
color: #FF0000;
background-color: #000000;
}
.style7 {color: #FF0000}
END;
?>
显示一些代码,没有人喜欢猜测答案 – Ibu 2011-05-22 22:10:53
是显示一些爱 – dynamic 2011-05-22 22:13:58
添加的代码到帖子 – Bigandrewgold 2011-05-22 22:29:01