473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Change the header of a page depending on the source.

We have two headers for a page. the firs header is displayed when we come to the page from site "X" and the second header is displayed when i come from site "Y". How can i check from which site i am coming to the page and accordingly display the right header? Please help me with code pieces.

Thank you
Apr 9 '08 #1
4 1262
Markus
6,050 Expert 4TB
We have two headers for a page. the firs header is displayed when we come to the page from site "X" and the second header is displayed when i come from site "Y". How can i check from which site i am coming to the page and accordingly display the right header? Please help me with code pieces.

Thank you
[php]
if($_SERVER['HTTP_REFERER'] == "http://somesite.com")
include("header_1.php");

else
# ....
[/php]

This help you?
Apr 9 '08 #2
ronverdonk
4,258 Expert 4TB
Wait a second: many ISP do not allow the user agent to write this field because it can easily be falsified. If it is set by the agent and you want to use it, fine, but never trust it for a second.

Ronald
Apr 9 '08 #3
Wait a second: many ISP do not allow the user agent to write this field because it can easily be falsified. If it is set by the agent and you want to use it, fine, but never trust it for a second.

Ronald

Hi Ronald,

I did not get what you said...could you be more clear as i am a beginner at all this. If that is not the right way what is the other way i can use??
Apr 9 '08 #4
TheServant
1,168 Expert 1GB
Hi Ronald,

I did not get what you said...could you be more clear as i am a beginner at all this. If that is not the right way what is the other way i can use??
He's just saying that you can manually submit the referrer and trick the page to thinking another page requested it. So if your header_1 was public, and your header_2 was private, it would be reasonably easy to get to your header_2 by making a fake request name. Not exactly sure how it works, but just becareful what you put in your headers if you use that method, as they are not very secure.

Another way would be to check the logins... Do you use a login system? As in can people register on your site?
Apr 9 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
8
by: Marcel | last post by:
hi, when i put data in my mysql table on mine local webserver it appears only when i change the html code of the page that contains the php code. I already put the meta-tag 'no-chache' on mine...
16
by: matthurne | last post by:
I just started learning C++ on my own...I'm using Accelerated C++. Something it hasn't explained and I keep wondering about is how header files actually work. I suspect it doesn't get into it...
4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
2
by: Annie | last post by:
hello guys, I have a header file in the form of user control (.ascx) that all my pages inherit from it. I have a textbox that i need to access it from all the pages actually i show there user...
22
by: Bob and Sharon Hiller | last post by:
I have an ASP page that was done in VBScript It is setup to read an Access database and I need to change it to read a Sql 2005 Database. The code that is used to open the Access Database: Set...
2
by: JRough | last post by:
I have this code that switches templates depending on if the user fills in a form with a request. The request asks for the $mark & $number. If that request gets input then it displays a list...
4
by: JRough | last post by:
I have this section at the end of a page ------------------- if ($_POST== 'Open in Excel'){ if (empty($data)) { $data = "\n(0) Records Found!\n";} header("Content-type:...
1
by: zandiT | last post by:
hello everyone when working with access reports using the grouping sections, how do you change the title of the group header section depending on which group is being displayed. i have a report...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.