Re: HELP: PHP Send mail problems.

Discussion in 'HTML' started by Jonathan N. Little, Aug 2, 2010.

  1. ing wrote:
    > mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
    > echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    > ?>


    This would be much better handled at a.c.l.p, but if you are using
    server side don't use META redirects, use PHP's header function:

    $url='http://example.com/WhereYouWantToGo.html';
    header("Location: $url");

    <http://www.php.net/manual/en/function.header.php>

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 2, 2010
    #1
    1. Advertising

  2. ing wrote:
    > On Mon, 02 Aug 2010 08:38:14 -0400, "Jonathan N. Little"
    > <> wrote:
    >
    >> ing wrote:
    >>> mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
    >>> echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    >>> ?>

    >>
    >> This would be much better handled at a.c.l.p, but if you are using
    >> server side don't use META redirects, use PHP's header function:
    >>
    >> $url='http://example.com/WhereYouWantToGo.html';
    >> header("Location: $url");
    >>
    >> <http://www.php.net/manual/en/function.header.php>

    >
    > Srry but you've completely baffled me and the web link is even
    > worse.The fact that I use Expression Web should tell you I'm not up on
    > coding. What is a Meta redirect? Where do I have them? Does your
    > header need to go in the HTML (calling) part of the PHP code part? How
    > do I type it if where I want it to go is an email to my inbox? I don't
    > want a web page, I want a message sent. TIA.


    After the line:
    mail($emailadd, $subject, $text, 'From: '.$emailadd.'');

    You are echoing in PHP:
    echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';

    That essentially create a HTML page use just this META tag redirect.
    This is NOT the way to redirect to the "response|thank you|your order
    been sent" page. PHP, (You do know you are using PHP, right?*) can not
    only send HTML output but can send info via the server headers that
    precedes the HTML output. That is what you want to do here, not send
    HTML output to do the redirect but send response headers to do the
    redirect, i.e. in place of your echo statement you want:

    header("Location: $url");

    Note*: Expression Web or any other misnomer WYSIWYG editor is *not* a
    substitute for know what you are doing. If you are going to use more
    than just static HTML and use server-side scripting like PHP in your
    pages, you really have to learn a bit about PHP. The manual link is a
    good place to start. Plenty of tuts on the web. I suggest you kit a few,
    else you could inadvertently hand the hackers a spam machine...


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 2, 2010
    #2
    1. Advertising

  3. Jonathan N. Little

    Doug Miller Guest

    In article <>, "" <> wrote:
    >Oops! Sorry. No it doesn't. I believe Doug Miller identified the fact
    >that the PHP script is never being called.


    I did nothing of the kind. You asserted that "nothing happened". And I
    questioned "nothing at all? not even invoking the script?"

    The script not being called is entirely an assumption on your part, and
    probably an incorrect assumption at that. Your biggest problem right now is
    that you have no idea what is or is not happening.

    > So the problem appears to
    >be in the HTML element.


    I doubt that very much. Have you checked your PHP error log to see if there's
    anything there that would indicate a problem?
     
    Doug Miller, Aug 2, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    3
    Views:
    1,973
    Larry Lard
    Nov 23, 2005
  2. =?Utf-8?B?Unlhbg==?=
    Replies:
    2
    Views:
    3,948
    Steven Cheng[MSFT]
    Feb 28, 2006
  3. Rajive Narain
    Replies:
    0
    Views:
    2,017
    Rajive Narain
    Sep 18, 2009
  4. rf
    Replies:
    13
    Views:
    984
    Peter
    Aug 4, 2010
  5. Doug Miller

    Re: HELP: PHP Send mail problems.

    Doug Miller, Aug 2, 2010, in forum: HTML
    Replies:
    9
    Views:
    519
    Raymond Schmit
    Aug 4, 2010
Loading...

Share This Page