SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Formhandler Problem

    I am using a formhandler script for my contact page that is supposed to grab the mailto address from line 9 of a flatfile, but it isn't working, any help?

    <?php
    $email = $HTTP_POST_VARS[email];

    $mailto = <?
    $lines = file('basedata.txt');
    $l_count = count($lines);
    for($x = 0; $x< $l_count; $x++)
    {
    }

    echo "" . $lines[9] . "" ;
    ?>;
    $mailsubj = "Website Contact Form submission";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site contact form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
    if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
    ?>


    I think my using a php script within a script is my problem.

  2. #2
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dunno if this ancient script ever working but here is getting mailto from 9-th line
    PHP Code:
    $lines file('basedata.txt');
    $mailto =  trim($lines[8]); 

  3. #3
    SitePoint Addict eanimator's Avatar
    Join Date
    Sep 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTTP_POST_VARS is obsolete don't use it.


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
  •