SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: http_referer

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2000
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I just finish to read the excellent article about the jokes program and I'm in the mood for programming My question is about http_referer. I create a "recommand this page to a friend" but I freeze with my http_referer code.

    On my form I have $referer = getenv("HTTP_REFERER"); so now I'm ok, I have the referer but my problem is to insert this http_referer into my database. I need 2 script, so I cannot use the php_self. I have the form from which I get the http_referer and my other script recommand_it.php3 to insert the info into the table. But as soon that I press the submit button I have for referer the name of my form
    I need a solution on how to fix my problem.
    I someone know a good tips or sample code please let me know!

    Regards!
    Jos

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure I understand your question... If you want someone to be able to type a value and pass it to recommand_it.php3, you can just use a simple form:

    Code:
    <FORM ACTION="recommand_it.php3" METHOD=POST>
    ...
    <INPUT TYPE=TEXT NAME="varName">
    <INPUT TYPE=SUBMIT>
    </FORM>
    Since this is covered pretty thoroughly in the article to which you refer, I'm assuming you're asking something more complex. I just can't figure out what.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use hidden field
    <INPUT NAME="referer" TYPE="HIDDEN" VALUE="whatever referer is">
    and then when sending that form read $referer you are there
    Great Dane
    Gokhan ARLI


Bookmarks

Posting Permissions

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