Re:无法重定向到Excel [英] Re: can't redirect to Excel

查看:112
本文介绍了Re:无法重定向到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JRough写道:


>我已经尝试了这4个星期,我需要一些帮助。此页面上还有3个其他

页面,但我将从这个页面开始

,以防我错过了什么。它被称为current_sightings.php。对于外部用户,我要做的所有
都是重定向到Excel。

第一个if语句创建一个表单。 elseif将

外部用户重定向到他自己的列表。我希望结果为

内部用户查询SELECT_sightings_leasecars。()转到我的

current_sightingsXL.php页面。我在哪里/如何进行重定向?我认为它应该是在为外部用户切换之后。

getTableHeaders()函数是传递的字符串。除了我不能将输出重定向到Excel之外,所有

页面都有效。



你的意思是将输出重定向到Excel是什么意思? Excel不是

位置,这是一个电子表格程序,有些(但不是所有用户)将在他们的机器上拥有



BTW,位置:应该采用完全限定的URL。

解决方案

Paul Lautman写道:


JRough写道:


>我已经尝试了这4周2周,我需要一些帮助。此页面上还有其他3个页面,但我将从这个页面开始
以防我错过了什么。它被称为current_sightings.php。我想要做的就是在外部用户的情况下重定向到Excel。
第一个if语句创建一个表单。 elseif将
外部用户重定向到他自己的列表。我希望
内部用户查询SELECT_sightings_leasecars。()的结果转到我的
current_sightingsXL.php页面。我在哪里/如何进行重定向?我认为它应该是在为外部用户切换之后。
getTableHeaders()函数是传递的字符串。除了我不能将输出重定向到Excel之外,所有
页面都有效。



你的意思是将输出重定向到Excel是什么意思? Excel不是

位置,这是一个电子表格程序,有些(但不是所有用户)将在他们的机器上拥有



BTW,位置:应该采用完全限定的URL。



什么是完全限定的URL?谷歌搜索让我比以前更加困惑




现在,这当然是完全合格的:


标题(位置:http://www.example.com/");


,这可能不是:

标题(地点:www.example.com/");


但是这个怎么样?:


header(Location:/ new_page_in_html_root.html");


或:


header(" Location:page_in_same_directory.html" );


现在,就操作所需要的内容而言,这一点并不清楚,你可以使用

标题语句(让它工作) )只要在标题之前没有输出html

(回显或嵌入)。

Jeff


>


Jeff写道:


Paul Lautman写道:


> JRough写道:


>>我已经尝试了这4个星期,我需要一些帮助。此页面上还有其他3个页面,但我将从这个页面开始
以防我错过了什么。它被称为current_sightings.php。在外部
用户的情况下,我想要做的就是重定向到Excel。第一个if语句创建一个表单。 elseif
将外部用户重定向到他自己的列表。我想要内部用户查询SELECT_sightings_leasecars的
结果。()
转到我的current_sightingsXL.php页面。在哪里/如何进行重定向?我认为应该是在切换外部用户之后。 getTableHeaders()函数是传递的字符串。除了我不能将输出重定向到Excel之外,所有页面都有效。


你的意思是将输出重定向到Excel是什么意思? Excel不是位置,它是一些电子表格程序,有些(但不是所有用户)
将在他们的机器上。

BTW,位置:应该是获取完全限定的URL。



什么是完全限定的URL?谷歌搜索让我比以前更加困惑。


现在,这当然是完全合格的:


标题(位置:http://www.example.com/");


,这可能不是:

标题(地点:www.example.com/");


但是这个怎么样?:


header(Location:/ new_page_in_html_root.html");


或:


header(" Location:page_in_same_directory.html" );



来自php手册:

HTTP / 1.1需要绝对URI作为Location的参数:包括

方案,主机名和绝对路径,但有些客户端接受相对URI。

您通常可以使用


_SERVER [''HTTP_HOST''],

JRough wrote:

>I have tried this 4 2 weeks and I need some help. There are 3 other
pages referenced on this page but I''m going to start with this page
in case I missed something. It is called current_sightings.php. All
I want to do is redirect to Excel in the case of the External user.
The first if statement creates a form. The elseif redirects the
external user to only his own listings. I want the results for the
Internal user query SELECT_sightings_leasecars.() to go to my
current_sightingsXL.php page. Where/How would I put the redirect? I
think it should be after the switch for external users. The
getTableHeaders() function is the string that gets passed. All the
pages work except I can''t redirect the output to Excel.

What do you mean by "redirect the output to Excel"??? Excel isn''t a
location, it''s a spreadsheet program that some (but not all users) will have
on their machine.

BTW, Location: is supposed to take a fully qualified URL.

解决方案

Paul Lautman wrote:

JRough wrote:

>I have tried this 4 2 weeks and I need some help. There are 3 other
pages referenced on this page but I''m going to start with this page
in case I missed something. It is called current_sightings.php. All
I want to do is redirect to Excel in the case of the External user.
The first if statement creates a form. The elseif redirects the
external user to only his own listings. I want the results for the
Internal user query SELECT_sightings_leasecars.() to go to my
current_sightingsXL.php page. Where/How would I put the redirect? I
think it should be after the switch for external users. The
getTableHeaders() function is the string that gets passed. All the
pages work except I can''t redirect the output to Excel.


What do you mean by "redirect the output to Excel"??? Excel isn''t a
location, it''s a spreadsheet program that some (but not all users) will have
on their machine.

BTW, Location: is supposed to take a fully qualified URL.

What is a fully qualified URL? A Google search has left me more confused
than before.

Now, this is of course, fully qualified:

header("Location: http://www.example.com/");

and this presumably isn''t:

header("Location: www.example.com/");

But what about this?:

header("Location: /new_page_in_html_root.html");

or:

header("Location: page_in_same_directory.html");

Now, as far as what the op wants, which isn''t clear, you can use a
header statement (and have it work) as long as there the is no html
outputted (either echoed or embedded) before the header.
Jeff

>


Jeff wrote:

Paul Lautman wrote:

>JRough wrote:

>>I have tried this 4 2 weeks and I need some help. There are 3 other
pages referenced on this page but I''m going to start with this page
in case I missed something. It is called current_sightings.php. All I
want to do is redirect to Excel in the case of the External
user. The first if statement creates a form. The elseif
redirects the external user to only his own listings. I want the
results for the Internal user query SELECT_sightings_leasecars.()
to go to my current_sightingsXL.php page. Where/How would I put
the redirect? I think it should be after the switch for external
users. The getTableHeaders() function is the string that gets
passed. All the pages work except I can''t redirect the output to
Excel.


What do you mean by "redirect the output to Excel"??? Excel isn''t a
location, it''s a spreadsheet program that some (but not all users)
will have on their machine.

BTW, Location: is supposed to take a fully qualified URL.


What is a fully qualified URL? A Google search has left me more
confused than before.

Now, this is of course, fully qualified:

header("Location: http://www.example.com/");

and this presumably isn''t:

header("Location: www.example.com/");

But what about this?:

header("Location: /new_page_in_html_root.html");

or:

header("Location: page_in_same_directory.html");

From the php manual:
HTTP/1.1 requires an absolute URI as argument to Location: including the
scheme, hostname and absolute path, but some clients accept relative URIs.
You can usually use


_SERVER[''HTTP_HOST''],


这篇关于Re:无法重定向到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆