#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    Hi,

    I've seen these scripts that allow you to email a friend an article, which is basically looks at the current url and emails it to the friend.

    Does php have this capability?

    Thanks!

  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    24
    Rep Power
    0
    yes it can
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    can you point me to the function? I don't need a sample script by any means.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    MO, US
    Posts
    119
    Rep Power
    15
    i think that tbalanco would like to know how...
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    45
    Rep Power
    15
    It depends on how you want to set this up exactly, but you can access the current URL by

    $current_url = $REQUEST_URI;

    if you want to get php to show you all the environmental variables, do:

    phpinfo();

    That'll show you all the variables you can use. Your question was very vague and therefore this answer is very vague, but I hope it helps!

  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    Thank you. I think that gives me a direction to research in my php books.

    Thanks!
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    56
    Rep Power
    15
    I haven't written such things, but here's how I would have done it. I would be storing my stories/tutorials/passages into a mySQL database, say table passages. It should have fields like passage_id and content. That would be how I display those passages anyways. So when someone clicked on the 'email to your friend' link, collect the email address(es), and then just use the mail() function and send out the content column of the specific row.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    thanks for the input. That's a good idea.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Niteroi, RJ, Brazil
    Posts
    30
    Rep Power
    15
    You can also open the file, use a regexp to strip out all html tags and send that in the email

    Of course you can make it better. You can strip out new lines, make <br> new lines, then you can switch table, for example, or <hr> for a

    ==================
    Text inside table
    End of table
    ==================

    or a HR:

    ---------------------------------

    And stuff like that. Not a bad idea, uh?

    ------------------
    Eduardo Teixeira Cardoso
    PHP Programmer from Brazil
    idnotfound@vircio.com.br
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    obrigado!
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    obrigado!
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Niteroi, RJ, Brazil
    Posts
    30
    Rep Power
    15
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by tbalanco:
    obrigado! [/quote]



    Brazilian?!



    ------------------
    Eduardo Teixeira Cardoso
    PHP Programmer from Brazil
    idnotfound@vircio.com.br

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 10:45 PM
  2. Replies: 4
    Last Post: January 28th, 2004, 08:29 AM
  3. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 01:14 PM
  4. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 03:12 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo