URL Catcher

Discussion in 'PHP' started by onlyican.com, Dec 7, 2005.

  1. #1
    Hi guys, i have forgotton, can't remember and can't find it.

    What is the php code for web catcher.

    For example, i want someone to complete a form, on completion, the form gets sent to a friend, with the url from where the form was sent from.
     
    onlyican.com, Dec 7, 2005 IP
  2. garysims

    garysims Well-Known Member

    Messages:
    287
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Maybe you are looking for $PHP_SELF.

    Gary
     
    garysims, Dec 7, 2005 IP
  3. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    is that the one in the form, <input type='hidden' name='url>$PHP_SELF
     
    onlyican.com, Dec 7, 2005 IP
  4. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Found it, for reference, it is
    $_SERVER['HTTP_REFERER']
    PHP:
    Another Question, the emails are sent by the server, so the emails are from nobody. How do i change that to my email address
     
    onlyican.com, Dec 7, 2005 IP
  5. HN Will

    HN Will Guest

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Take a look at the mail() function. You can pass all the headers you want.
     
    HN Will, Dec 7, 2005 IP
  6. garysims

    garysims Well-Known Member

    Messages:
    287
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    108
    #6
    For sending emails I would suggest you don't use the built in functions but rather use phpMailer which is much more powerful.

    Gary
     
    garysims, Dec 7, 2005 IP
  7. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorted now, thanks.

    The reason why i wanted a form, is because i was building a "tell a friend" sort of page. so when the form is sent, an email is sent with the page link.

    I am learning php, and i like to try and do stuff using codes, not plugins
     
    onlyican.com, Dec 7, 2005 IP