Jump to content

Working on a Contact Me script, and need some help


justin15

Recommended Posts

Hello, this is my first post, and I hope will be one of many, Because I'll admit, I am a PHP Newb, but anyway, I need help with a script I am working on, it seems to do nothing of what I want it to, I will post the HTML and PHP Code below.
[i]Script is not close to done. I am still adding more features, lots .. I hope ![/i]


[b]HTML:[/b]
[code]
<form action="comment.php" method="post">
<B>Name:</B><input type="text sixe="20" value="Your Name." name="comments1"></input><BR>
<B>E-Mail (Optional):</B><input type="text sixe="20" value="Your E-Mail (Optional)" name="comments2"></input><BR>
<B>Comments:</B><BR>
<textarea value="Your Comments Here" rows="10" name="comments3">
</textarea><BR>
<input type="submit" value="Send">
</form>
[/code]

[b]PHP:[/b]
[code]
<php

$comments1 = $_POST['comments1'];
$comments2 = $_POST['comments2'];
$comments3 = $_POST['comments3'];

echo $comments1;



?>
[/code]

All I want to make it do, as of now, is take the Name, E-Mail, and Comments from the last page and display it, Thats it for now.

Thanks
Link to comment
Share on other sites

I am getting plain nothing, when you click the submit button, you get a blank page ... I will post a link below


[a href=\"http://24.215.127.102/PHP/comment/\" target=\"_blank\"]Here you go, click here to see the script on a Working PHP Enabled server.[/a]
Link to comment
Share on other sites

Oh, sorry I failed to see your error. The start tag:

[code]<php[/code]

should be:

[code]<?php[/code]

[b]Tip:[/b] Whenever you have display issues, open the generated source. It may show you things your browser hide from you.
Link to comment
Share on other sites

Ahh, Thank you ! Very good, now I shall be off to make more features / finish the script, or atleast try to work on it ! ! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
Link to comment
Share on other sites

Ok, Got a little bit farther ... But now I have screwed up again, But I am pretty sure on the line I messed up on.

[b]PHP Code:[/b]
[code]
<div align="center">
<?php

$comments1 = $_POST['comments1'];
$comments2 = $_POST['comments2'];
$comments3 = $_POST['comments3'];

echo "Your information will display below, if this information is right please continue on by pressing <I>Continue</I> farther down the page";
echo "Your name is" $comments1 "Your E-Mail is" $comments2 "Your comments are" $comments3;



?>
</div>
[/code]

Now the code will work without the second echo
[b]Second Echo Code:[/b]
[code]
echo "Your name is" $comments1 "Your E-Mail is" $comments2 "Your comments are" $comments3;
[/code]

So, my guess is that I am not using the Varibles right, But I am still learnin, so .. Whatever .. lol

Anyway, Thanks again.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.