Professional Web Applications Themes

Please help a Newbie - PHP Development

I'm at beginning of the PHP learning curve. Will someone out there help me with this problem. On the client side the user fills in a form in HTML and submits with: <form NAME="Mail" METHOD=POST ACTION="phpemail.php"> snip <input TYPE="submit" VALUE="Send"> then my PHP code on the server side is: <?php $Message = "Customer Name = ".$_REQUEST["Customer"]; $Message .= "\nCompany Name = ".$_REQUEST["Company"]; $Message .= "\nAddress 1 = ".$_REQUEST["Address1"]; $Message .= "\nAddress 2 = ".$_REQUEST["Address2"]; $Message .= "\nAddress 3 = ".$_REQUEST["Address3"]; $result = mail("net", "Name And Address", $Message); ?> This does what it should, but it also echos a screen to ...

  1. #1

    Default Please help a Newbie

    I'm at beginning of the PHP learning curve.
    Will someone out there help me with this problem.

    On the client side the user fills in a form in HTML and submits
    with:
    <form NAME="Mail" METHOD=POST ACTION="phpemail.php">
    snip
    <input TYPE="submit" VALUE="Send">
    then my PHP code on the server side is:
    <?php
    $Message = "Customer Name = ".$_REQUEST["Customer"];
    $Message .= "\nCompany Name = ".$_REQUEST["Company"];
    $Message .= "\nAddress 1 = ".$_REQUEST["Address1"];
    $Message .= "\nAddress 2 = ".$_REQUEST["Address2"];
    $Message .= "\nAddress 3 = ".$_REQUEST["Address3"];
    $result = mail("net", "Name And Address", $Message);
    ?>
    This does what it should, but it also echos a screen to the client.
    How do I stop or prevent the echo?

    Thanks for any help

    dougjones


    Doug Guest

  2. #2

    Default Re: Please help a Newbie

    Doug Jones wrote: 

    Have a look at http://www.php.net/exit


    JW



    Janwillem Guest

  3. #3

    Default Re: Please help a Newbie

    Doug Jones wrote: 

    What do you mean by echos a screen? You mean you get a blank page?
    If you don't want that but calling another page use the header function.

    header("Location: http://www.foo.bar");

    Regards
    Stefan
     
    Stefan Guest

  4. #4

    Default Re: Please help a Newbie


    "Stefan Rybacki" <net> wrote in message
    news:net... 
    >
    > What do you mean by echos a screen? You mean you get a blank page?[/ref]
    Yes. [/ref]

    Doug Guest

  5. #5

    Default Re: Please help a Newbie

    Doug Jones wrote: 
     
    >
    > Yes.[/ref]

    Ok. So you want to use the header function to redirect to another page.
    I also recommend the global $_SERVER to construct the correct redirect address.

    $_SERVER['SERVER_NAME'] and
    $_SERVER['PHP_SELF']

    can help you to get the current server and directory.

    Further questions?

    Regards
    Stefan

     
    Stefan Guest

  6. #6

    Default Re: Please help a Newbie


    "Janwillem Borleffs" <com> wrote in message
    news:4304fc76$0$88444$euronet.nl... 
    >
    > Have a look at http://www.php.net/exit
    >
    >
    > JW
    >
    >
    >[/ref]
    I can't see the connection so to speak. No help at that link.

    Thanks

    DJ


    Doug Guest

Similar Threads

  1. A newbie with a newbie question
    By dusty_davis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: October 14th, 07:54 AM
  2. From Help For Newbie...
    By chuk looper in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: December 5th, 09:49 PM
  3. Replies: 5
    Last Post: December 3rd, 10:44 AM
  4. Newbie Newbie Needs Help with starting
    By Rick in forum PHP Development
    Replies: 5
    Last Post: December 17th, 11:20 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139