在没有重定向的情况下以隐藏模式打开URL

时间:2015-04-18 19:08:28

标签: php

第1页:

<form method="GET">
<input type="submit" id="submit" name="submit" value="Start">
</form>
<?php 

if(isset($_GET['submit'])){
fopen('http://localhost/sn/test2.php?name=ttest11&post=hi1&submit=Start
','r');

fopen('http://localhost/sn/test3.php?name=ttest22&post=hi2&submit=Start
','r');


fopen('http://localhost/sn/test4.php?name=ttest33&post=hi3&submit=Start
','r');
}
?>

Page test2,test3,test3 ......:

<form method="get">
<input type="text" name="name" id="name" size="14" maxlength="20">
<input type="text" name="post" id="post" size="5" maxlength="5" >
<input type="submit" id="submit" name="submit" value="Start">
</form>

<?php 
if(isset($_GET['submit'])){
// ..... hidden code, to sent messages...... 
}

?>

页面test2,test3,test4被编程为在我点击下面的按钮开始时发送电子邮件,或者我直接启动链接。

http://localhost/sn/test2.php?name=ttest11&post=hi1&submit=Start

将自动发送消息。

我的问题是:我想当我点击第一页上的开始按钮时,其他页面'(test2,test3,test4)链接以隐藏模式启动(发送电子邮件为链接),没有重定向或任何事情,只需(点击)所有链接都将启动。然后自动发送电子邮件

我真的需要帮助。

1 个答案:

答案 0 :(得分:1)

你应该尝试ajax功能。 Ajax并异步调用任何页面并执行php任务。  即。

$.ajax({
  method: "POST",
  url: "some.php",
  data: { name: "John", location: "Boston" }
})
相关问题