Is there a way to automatically go to a URL returned via XML from an API call? For instance I call and it returns the XML file that I parse with simple_xml_load() and then I create a link like so,

有没有办法自动转到从API调用通过XML返回的URL?例如,我调用它返回我使用simple_xml_load()解析的XML文件,然后我创建一个这样的链接,

<a target=_blank href='" . $title->links->homedetails . "?scrnnm=Nexus-Software'>".
$title->address->street . "</a>

But I do not want the user to have to click, is there a way to have the page automatically go to that returned link after submitting the form?

但我不希望用户必须单击,有没有办法让页面在提交表单后自动转到返回的链接?

2 个解决方案

#1


If I understood your question correctly this would do the trick:

如果我正确理解你的问题,那就可以了:

<?php header('Location: '.$title->links->homedetails.'?scrnnm=Nexus-Software'); ?>

It redirects the user to the location specified. You just have to watch out to call it before any output is sent to the browser.

它将用户重定向到指定的位置。在将任何输出发送到浏览器之前,您只需要注意调用它。

You can find some more info at: http://pl2.php.net/manual/pl/function.header.php

您可以在http://pl2.php.net/manual/pl/function.header.php找到更多信息

更多相关文章

  1. 在MySQL数据库中存储无法访问的用户
  2. init-connectMysql对用户操作加审计功能
  3. 一些值得收藏的MySQL知识链接
  4. mysql user表root 用户修改权限后出现无法访问数据库的解决方法
  5. Linux下修改MySQL初始密码、开启远程登录、授权远程登录用户
  6. 保存在Java桌面应用程序应用程序和网站上使用的个人用户设置的最
  7. 是一个mysql临时表,每个用户访问创建它的脚本是唯一的...?
  8. MVC框架——学生信息管理系统(多表,多事务如何处理,一个用户如何共
  9. java链接数据库--Mysql

随机推荐

  1. 五分钟看懂一道中等难度的算法题
  2. 学算法的那些年,吴师兄接触的网站、软件、
  3. 这是什么沙雕题目?测试用例居然有人身高为
  4. 惊叹,Pyecharts绘制饼图原来可以如此漂亮!
  5. 结婚这件小事
  6. Matplotlib 动态图还可以这样玩,收藏了!
  7. (美团)巧用数组下标,轻轻松松找出所有元素
  8. 字节一面,面试官告诉我链表掌握的不熟练
  9. 晚上看了轮子哥的知乎想法,我失眠了
  10. 计算机专业的学生怎样练习编程才能把编程