Results 1 to 5 of 5

Thread: Learning Php

  1. #1

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Learning Php

    Well I have taken up the task of trying to learn this, while working with VB as well, since I am starting up a new website and I don't feel like paying for the scripts.

    Anyways, I have learned some basics and had a question. On my webform I am using a Text Area for a user to fill out comments, and it's name is of course "comments". So when it's submitting here is what I am using to process it:

    Your comments:<p>
    <?php Print $comments; ?>
    <p>

    And it's simply displaying nothing, why is it doing that?

    My Text Area code:

    <TEXTAREA NAME="comment" ROWS=6 COLS=40>
    </TEXTAREA><br>
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


  2. #2
    Junior Member christoph's Avatar
    Join Date
    Aug 2005
    Posts
    23

    Re: Learning Php

    Two things. First, your textarea name is "comment" and you're trying to print "comments". Second, try the following code instead:

    PHP Code:
    $comments = ($_POST['comments']);
    echo(
    "$comments"); 
    Hope this helps.
    -chris
    "Never put off till tomorrow what you can do today" Thomas Jefferson

  3. #3

    Thread Starter
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: Learning Php

    Thanks that got it, one more thing while I am here. I basicly have the basic basics down now (print if loop functions) etc. And I am trying to use the email function, to email the data to myself here is my full code:

    PHP Code:
    <Html>
    <Head>
    <title>Your submission</title>
    </Head>
    <body bgcolor="#FFFFFF" text="#000000">
    <?php
    if ($Email <> "Alias") {
    Print (
    "Invalid Email!");
    }
    ?>
    <p>
    Your Name:<p>
    <?php
    Print $Name;
    ?>
    <p>
    Your email:<P>
    <?php Print $Email?>
    <p>
    Your Submitted Url:<p>
    <?Php Print $Program?>
    <p>
    Your comments:<p>
    <?Php Print $comment?>
    <p>
    <?php

    $message 
    "$Name\nLine $Email\nLine $Program\nLine $comment";


    $message wordwrap($message70);


    mail('[email protected]''New Program Submitted!'$message);
    ?> 
    </Body>
    </Html>
    Except, im not getting any emails. Any idea?
    Age - 15 ::: Level - Advanced
    If you find my post useful please ::Rate It::


  4. #4
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394

    Re: Learning Php

    Mail function takes 4 arguements
    mail("recepient","subject","message","mail headers");

    mail headers includes your from address
    You can find sample prototypes on the web.
    Truly, you have a dizzying intellect.

  5. #5
    Junior Member christoph's Avatar
    Join Date
    Aug 2005
    Posts
    23

    Re: Learning Php

    Replace your mail function with this:

    PHP Code:
    $headers  "From: \"Me\"<[email protected]>\n";
    mail('[email protected]''New Program Submitted!'$message$headers); 
    -chris
    "Never put off till tomorrow what you can do today" Thomas Jefferson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width