phpmady Posted June 14, 2010 Share Posted June 14, 2010 Hi guys, Here i am trying to get the url of the current page and trying to pass to the php page Tellafriend.html <span> <a href="tell_a_friend.php?url=<SCRIPT LANGUAGE="JavaScript"> document.write(location.href); </SCRIPT>" target="page" onClick="window.open('','page','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=550,height=410,left=50,top=50,titlebar=yes')">Tell A Friend</a> </span> How to achieve this thanks Link to comment https://forums.phpfreaks.com/topic/204724-tell-a-friend/ Share on other sites More sharing options...
l4nc3r Posted June 14, 2010 Share Posted June 14, 2010 Here are the steps: 1. Learn English. 2. Learn English. 3. Learn how to ask a question. http://www.catb.org/~esr/faqs/smart-questions.html 4. Learn the difference between PHP and Javascript. 5. Learn how to use Google (note you might want to do this before step 4) :http://www.lmgtfy.com/?q=php+get+current+page+url Link to comment https://forums.phpfreaks.com/topic/204724-tell-a-friend/#findComment-1071812 Share on other sites More sharing options...
phpmady Posted June 14, 2010 Author Share Posted June 14, 2010 Here are the steps: 1. Learn English. 2. Learn English. 3. Learn how to ask a question. http://www.catb.org/~esr/faqs/smart-questions.html 4. Learn the difference between PHP and Javascript. 5. Learn how to use Google (note you might want to do this before step 4) :http://www.lmgtfy.com/?q=php+get+current+page+url Thanks Link to comment https://forums.phpfreaks.com/topic/204724-tell-a-friend/#findComment-1071815 Share on other sites More sharing options...
ignace Posted June 14, 2010 Share Posted June 14, 2010 Not sure what you want to achieve, but: <span> <a href="tell_a_friend.php?url=<?php print 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']); ?>"> Tell A Friend </a> </span> Link to comment https://forums.phpfreaks.com/topic/204724-tell-a-friend/#findComment-1071973 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.