www.webdeveloper.com
Results 1 to 4 of 4

Thread: secure tell a friend...

  1. #1
    Join Date
    Nov 2005
    Location
    A Northern Soul Living nr London
    Posts
    215

    Angry secure tell a friend...

    Hi all,

    My php skills are ok, and I thought I’d got things sorted but… my site will be heavily dependant on word of mouth for its proliferation so I used a “tell-a-friend” script. Put it on line and 12 hours later my first spammer hit and I took the script offline!

    So, does anyone have any suggestions, scripts, ideas on how a script can be made more secure?

    To be honest I am now getting bogged down with work on other areas of the site and could use a ready-made script…

    Many thanks

    Mouse
    Theres no place like 127.0.0.1

    ok, here i go, my background is more in CSS, HTML, PhotoShop and Dreamweaver... but i am trying to learn the ins and outs of PHP... now for the rub i am dyslexic, so please bear with me.

    currently working on:- http://mouse.nodstrum.com

  2. #2
    Join Date
    Oct 2005
    Location
    Gold Coast, Australia
    Posts
    2,115
    Well rather then start from scratch, could you post your current “tell-a-friend” script and we will see what we can do.

  3. #3
    Join Date
    Jun 2004
    Location
    48°46′36″ N 9°10′48″ E
    Posts
    3,747
    yes, post the script
    and tell us what kind of spam it was

  4. #4
    Join Date
    Nov 2005
    Location
    A Northern Soul Living nr London
    Posts
    215
    Code:
    <b>Tell a friend about our site!</b>
    <p>
    <?php
    If ($to_email && $message && $subject) {$to = "\"$to_name\" <$to_email>";
    $from = "\"$from_name\" <$from_email>";
    $to = str_replace("\\'", "'", $to);
    $from = str_replace("\\'", "'", $from);$subject = str_replace("\\'", "'", $subject);
    $message = str_replace("\\'", "'", $message);
    mail($to, $subject, $message, "From: $from\nX-Mailer: My Website");
    echo "Mail message sent : \nTo : $to\nFrom : $from\nSubject : $subject\nMessage : $message";
    exit; } ?>
    
    <form action=<?php echo $PHP_SELF; ?> METHOD=POST>
    To (Friend's name): <input type=text name=to_name>
    <br>
    To (Friend's email): <input type=text name=to_email>
    <br>
    From (Your name): <input type=text name=from_name>
    <br>
    From (Your email): <input type=text name=from_email>
    <br>
    Subject : <input type=text name=subject>
    <p>
    Message: <textarea name=message cols=60 rows=10>
    Hi!
    
    I found this page and thought you'd be interested.
    
    Link:
    <? if (empty($HTTP_REFERER)) { $referrer = 'No referrer reported'; } else { $referrer = $HTTP_REFERER; } echo $referrer; ?>
    </textarea>
    <p>
    <input type=submit value=Mail></form>
    as you can see (as di i NOW) this is a very basic script... i added a few tweaks and CSS but this is the basic starting block... again any help greatfully recieved.

    Mouse
    Theres no place like 127.0.0.1

    ok, here i go, my background is more in CSS, HTML, PhotoShop and Dreamweaver... but i am trying to learn the ins and outs of PHP... now for the rub i am dyslexic, so please bear with me.

    currently working on:- http://mouse.nodstrum.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