【发布时间】:2014-06-16 07:00:55
【问题描述】:
我正在尝试从我们的数据库中获取用户数据,然后自动将这些用户传递给我的 gotowebinar。自动化代码将在 php.ini 中完成。这是代码。我想知道为什么它不会将数据传递到 gotowebinar 页面。我能够成功检索数据。但是,当我将表单“post”的代码添加到 gotowebinar 时,它不会传递数据。我希望你能帮我解决这个问题。非常感谢。
<?php
$conn = new mysqli("mywebsite.com", "myusername", "mypassword", "mydatabase");
// check connection
if ($conn->connect_error) {
trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
}
$sql = "SELECT name, email FROM users WHERE username = 'Manny'";
$rs=$conn->query($sql);
$rs->data_seek(0);
while($row = $rs->fetch_assoc()){
?>
<form action="https://attendee.gotowebinar.com/register/11111111111" id="formGTW" method="post">
<input type="hidden" name="registrant.givenName" value="<?php echo $row['name'] ?>" />
<input type="hidden" name="registrant.surname" value="GTN" />
<input type="hidden" name="registrant.email" value="<?php echo $row['email'] ?>" />
<script type="text/javascript">
$(document).ready(function(){
$("#formGTW").submit();
});
</script>
<?php } ?>
</form>
【问题讨论】:
-
您正在多次打印
<form ac...以及 javascript。