|
-
Aug 10th, 2005, 04:32 AM
#1
Thread Starter
Frenzied Member
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::

-
Aug 10th, 2005, 07:17 AM
#2
Junior Member
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
-
Aug 10th, 2005, 01:42 PM
#3
Thread Starter
Frenzied Member
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($message, 70);
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::

-
Aug 10th, 2005, 06:26 PM
#4
Hyperactive Member
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.
-
Aug 10th, 2005, 06:37 PM
#5
Junior Member
Re: Learning Php
Replace your mail function with this:
-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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|