www.webdeveloper.com
Results 1 to 3 of 3

Thread: How to grab the page url in an email form?

  1. #1
    Join Date
    Oct 2013
    Posts
    1

    How to grab the page url in an email form?

    Hi all,

    I'm working on a site with an email form on each page, if possible, I would like it to automatically grab and send the page url to the email address which the form directs to (as a part of the message). Is there any way to do this?

    Thank you,
    Evan

  2. #2
    Join Date
    Jul 2013
    Posts
    351
    If what you are saying is you want the url of the page from which you are gathering the email info from and from which you end up sending the mail, then I think you mean to use $_SERVER['PHP_SELF'].

  3. #3
    Join Date
    Sep 2013
    Posts
    221
    Try out with the below code:

    <form name="myform" action="<?=$_SERVER['PHP_SELF']. "?" . $_SERVER['QUERY_STRING'];?>" method="GET">

    or could you echo $location; die; after this line:

    $location = $_GET['current_url'];

    Hope this helps.
    strad solutionswww.stradsolutions.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles