Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Sir,
I have a php page and with php way I get the information with below code:
$link = $_SERVER['HTTP_REFERER'];
and but now I want get this information with "document.referrer" and then send to php.
I don't know how i can send this information to php.

Best Regards
Posted
Updated 24-Apr-15 4:18am
v3
Comments
Sascha Lefèvre 24-Apr-15 10:12am    
Please don't crosspost.
Sergey Alexandrovich Kryukov 24-Apr-15 10:16am    
That was a wrong place for this question, but this forum is a right place, so I answered, please see.
That old message can be removed.
—SA
Sascha Lefèvre 24-Apr-15 10:18am    
Alright

1 solution

I assume you mean JavaScript in a Web browser. As "to PHP" means server-side, you need to send HTTP request to it, which is done via AJAX: http://en.wikipedia.org/wiki/Ajax_%28programming%29[^].

One of the convenient ways of using AJAX would be jQuery .ajax():
http://api.jquery.com/jquery.ajax[^].

—SA
 
Share this answer
 
Comments
Sascha Lefèvre 24-Apr-15 10:19am    
5ed.
Sergey Alexandrovich Kryukov 24-Apr-15 14:20pm    
Thank you, Sascha.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900