将用户重定向到index.php [英] Redirect user to index.php

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

问题描述

我有一个site.php页面,其中包含以下

标题(位置:http://www.external site.co.za);

? >



在我的index.php页面中



i有一个链接选择



如果用户点击链接,他将被导向fancybox内的site.php,他不会知道外观url和他不必离开我的页面。



但是如果用户输入http://www.mysitename/site.php它会打开外部网站。我无法保护s​​ite.php页面,因为您无需登录。这只是他需要的信息然后回到我身边。



如果用户这样做,它必须将site.php重定向到我的index.php



谢谢

解决方案

或通过JavaScript

window.location = 'http://www.yoursite.com/whereyouwanttogo.php';



或用PHP

标题(位置:www。 yoursite.com/whereyouwanttogo.php)

i have an site.php page with the following
header (location: "http://www.external site.co.za");
?>

In my index.php page

i have a link Selection

If user click on link he wil be directed to site.php within fancybox and he wont know the exterior url and he wont have to leave my page.

But if user types in http://www.mysitename/site.php it open the external site. I cannot protect the site.php page because you dont have to log in . It is just an information he needs and then back to my side.

Is it possible that if a user does this it must redirect site.php to my index.php

Thank you

解决方案

Or by JavaScript
window.location='http://www.yoursite.com/whereyouwanttogo.php';

Or in PHP
header("Location: www.yoursite.com/whereyouwanttogo.php")


这篇关于将用户重定向到index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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