Basic Web Data Capture

Discussion in 'Technology' started by trance_fan, May 11, 2006.

Users Viewing Thread (Users: 0, Guests: 0)

  1. trance_fan

    trance_fan Registered User

    Joined:
    Nov 7, 2002
    Messages:
    9,079
    Likes Received:
    0
    Basic Web Data Capture

    wanting to capture name, address, and some basic info via forms/input boxes, whatever (its for a quotation system) and then email this to the relevant person...

    How hard is this to do?

    Some pointers would be good. The fact that i know nothing about this sort of thing doesn't seem to phase my boss at all!!

    I presume you will need to use a mail relay? How do you set that up?
  2. 1615634792921.png
  3. Lee

    Lee original gowans artwork

    Joined:
    Jan 7, 2005
    Messages:
    9,453
    Likes Received:
    0
    Location:
    Seaham
    its pissoir, i did it at college but alas ive forgotten :lol: its not hard to do tho, if you find it on a tutorial site let me know the link:D
  4. trance_fan

    trance_fan Registered User

    Joined:
    Nov 7, 2002
    Messages:
    9,079
    Likes Received:
    0
    about as much use as a cock flavoured lollipop!
  5. Sleepy

    Sleepy Registered User

    Joined:
    Mar 15, 2002
    Messages:
    16,777
    Likes Received:
    0
    if you want to be a REAL geek you need to know more than this chris!!!

    google - theres hundreds if not thousands of tutorials!

    lazy lazy people! :lol:

    ps. yes u need an smtp server to relay through, theres a start for ya :p
  6. Jason Bourne

    Jason Bourne Registered User

    Joined:
    Oct 14, 2002
    Messages:
    5,337
    Likes Received:
    0
    I would use ASP to process the data and then relay through an SMTP..

    You could use PHP though..
  7. trance_fan

    trance_fan Registered User

    Joined:
    Nov 7, 2002
    Messages:
    9,079
    Likes Received:
    0
    Well I have found a php script that is very simple...didnt require any SMTP config so i assume it must just use the mail on the host....i have modified it for my needs, sends data from a form.

    The script:



    <?

    // ------------- CONFIGURABLE SECTION ------------------------

    // $mailto - set to the email address you want the form
    // sent to, eg
    //$mailto = "youremailaddress@example.com" ;

    $mailto = 'myemailaddress@mywork.com' ;

    // $subject - set to the Subject line of the email, eg
    //$subject = "Feedback Form" ;

    $subject = "Quote Recieved" ;

    // the pages to be displayed, eg
    //$formurl = "http://www.example.com/feedback.html" ;
    //$errorurl = "http://www.example.com/error.html" ;
    //$thankyouurl = "http://www.example.com/thankyou.html" ;

    $formurl = "http://www.example.com/feedback.html" ;
    $errorurl = "http://www.example.com/error.html" ;
    $thankyouurl = "http://www.example.com/thanks.html" ;

    $uself = 0;

    // -------------------- END OF CONFIGURABLE SECTION (ahem)---------------

    $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
    $name = $_POST['name'] ;
    $email = $_POST['email'] ;
    $telephone = $_POST['telephone'] ;
    $comments = $_POST['comments'] ;
    $http_referrer = getenv( "HTTP_REFERER" );

    if (!isset($_POST['email'])) {
    header( "Location: $formurl" );
    exit ;
    }
    if (empty($name) || empty($email) || empty($telephone) || empty($comments)) {
    header( "Location: $errorurl" );
    exit ;
    }
    if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) || ereg( "[\r\n]", $telephone )) {
    header( "Location: $errorurl" );
    exit ;
    }

    if (get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
    }

    $messageproper =

    "New Quote Requested from Todd & Cue Pub Quote\n" .
    "---------------------------------------------\n\n" .
    "Name of sender: $name\n" .
    "Email Address: $email\n" .
    "Telephone Number: $telephone\n" .
    "\n" .
    "Details:\n\n" .
    $comments .
    "\n\n\n" ;

    mail($mailto, $subject, $messageproper,
    "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
    header( "Location: $thankyouurl" );
    exit ;

    ?>

    So just using it with a html form...just need to make it bigger!

    It could be used for mischief lol, if the recipient doesnt know the crack about email headers, you could send it from "admin@microsoft.com" :lol:

Share This Page