It is currently Tue May 22, 2018 8:02 am


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Help with a comment box
PostPosted: Thu Aug 09, 2007 4:12 pm 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
I am looking for a code that will insert a box on my main or a dedicated web page where people can enter their comments and when they press an enter button, the message is sent to an email address or some other location for me to read. Once sent, the box will again be empty and ready for the next person. Past comments will not be visible to the viewers as in a forum.

I now have our email address on there but, for some reason, people don’t use it. I have also had a guest book in the past and all I got was garbage. Is it possible that I will get the same with this method?
Thank you
Arvid
http://ourmnacres.us

_________________
http://ourmnacres.us


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 6:10 pm 
Experienced
Experienced

Joined: Fri May 13, 2005 10:24 am
Posts: 54
use the mail function:

Code:
<?
if(isset($_POST['msg'])){
  $x = mail("your email", "automated msg?", $_POST['msg']);
  if($x){
    echo "your message has been emailed to the admin.";
  }else{
     echo "sending message failed.";
  };
};
?>
<form action="?" method="post">
leave a message<br>
<textarea name="msg" id="msg"></textarea>
<br><input type="submit" name="sbmit" id="sbmit" value="Submit" />
</form>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 6:30 pm 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
Thank you. I'll give that a try.

Arvid

_________________
http://ourmnacres.us


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 10:40 pm 
Experienced
Experienced

Joined: Fri May 13, 2005 10:24 am
Posts: 54
I knew short-tags would be enabled and it saves space(especialy if you open them a lot because you have lots of small files or such).

I declared the variable $x because normaly I would gather a query string, and use a header location to make sure that pressing reload does not resend the email, I changed my mind since the whole reloading things involves explination in some case.

form itself is a block element by default(unless you use some weird css) and I assumed that the user could format it without help.

oh, and while we are on that rows and cols atributes are depreciated. Use CSS.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 14, 2007 8:43 pm 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
I am sorry to report that neither of these two scripts worked. Neither sent the email plus other problems.

I have no idea how to troubleshoot. If you do happen to return to this thread and see this, post here and I'll explain more what happened.

Again, thanks for yor help

Arvid

_________________
http://ourmnacres.us


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 14, 2007 11:58 pm 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
If I understand you correctly, my email account - ws1.100ws.com - should go in place of - 'your email'

Then, where should the actual email address go?

_________________
http://ourmnacres.us


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 15, 2007 12:23 am 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
Yes, I tried inserting my ourmnacres.us email address as well and it didn't work.

I looked at the web page "view source" and I see that my web design program, N|vu, removed part of the script. The part starting with "<?php echo" and ending with "?>" is not in there. This program does have a mind of it's own and will change things at times. Other than that, if it wasn't so easy to use, I would change.

I am able to type a message in the box.

Now, this is starting to take a lot of your time and I really appreciate it. If you don’t have the time to continue, I understand. Just let me know.

_________________
http://ourmnacres.us


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 15, 2007 1:42 am 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
I put the missing string back in. It now appears within the text box.

If you want to look at it, go to http://ourmnacres.us/testbox.html

Thank you
Arvid

_________________
http://ourmnacres.us


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 15, 2007 2:18 pm 
Noobie
Noobie

Joined: Fri Apr 08, 2005 1:35 am
Posts: 18
Location: Central MN
This is getting entirely to complicated for me :? Apparently, I cannot simply rename the file from testbox.html to testbox.php. I would guess some changes might be required in the header as well. I also tried to change the file name to mail.php to match the existing action. As soon as I change from html to php, the file becomes unusable.

This form is exactly what I want but, obviously, it is far beyond my capability and, until I learn more about php and programming in general, I don’t feel it is fair to ask you to spend more time guiding a neophyte such as myself.

Thank you for your help.

Arvid

_________________
http://ourmnacres.us


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ]  Moderators: fhmagic, KJ, Support Team, Moderators

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
100WebSpace © 2011