email notification of comments?

drewdomkus

Joined: 2002-09-06
Posts: 7
Posted: Fri, 2002-09-06 14:53

is this possible?
anyone done this?

searching the forum yielded no clues.

thanks

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sat, 2002-09-07 05:06

Sure it's possible, edit add_comment.php to fire off an email to whomever
after the save() call and before the dismiss() call.

 
drewdomkus

Joined: 2002-09-06
Posts: 7
Posted: Sat, 2002-09-07 15:30

thanks, but could you give me an example of what would fire the email off?
i'm still sorta new to .php

i'd really appreciate it.
thanks.

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sun, 2002-09-08 05:52

Well, you can try the php mail() function.
Have a look at http://www.php.net/docs.php and look it up.

 
drewdomkus

Joined: 2002-09-06
Posts: 7
Posted: Mon, 2002-09-09 03:55

that rocks!
works like a charm.

one more thing though...
do you know the variable that would let me post the gallery name or url through to the email?

i've tried:
$gallery (which comes back as "Object")
$index will give me the number image in the album
$comment_text (works like i thought)
$commenter_name (works like i thought)

i'd really like the url, but $albumURL doesn't return anything

thanks!

 
Eoin

Joined: 2002-09-03
Posts: 8
Posted: Mon, 2002-09-09 10:31

Well, as for the album title try $gallery->album->fields["title"] . You can see this and more variables in classes/Album.php.

I think makeAlbumUrl($gallery->session->albumName) creates an url for the currect album.

 
drewdomkus

Joined: 2002-09-06
Posts: 7
Posted: Mon, 2002-09-09 12:46

:???:
didn't work...

makeAlbumUrl($gallery->session->albumName) gave me:
makeAlbumUrl(Object->albumName)

$gallery->album->fields["title"] gave me:
Parse error: parse error in /home/httpd/vhosts/cyberdorks.com/httpdocs/gallery/add_comment.php on line 47

any other idea? i've tried a lot of the variables that i've seen in the other files, but only the $commenter_name and $comment_text seem to want to work.

 
bpd@darb.net

Joined: 2002-08-20
Posts: 101
Posted: Tue, 2002-09-10 00:46

can anyone tell me what chunk of PHP I need to dump into what file?

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Tue, 2002-09-10 02:48

drewdomkus, try scanning through the html_wrap directory, there
are some usefull function calls there for things. I can't think of them
off the top of my head though. Otherwise, scan for similar calls in the
add comments file and adjust to suite your needs.

, I don't understand what it is you are asking for?

 
drewdomkus

Joined: 2002-09-06
Posts: 7
Posted: Tue, 2002-09-10 19:56
Quote:
can anyone tell me what chunk of PHP I need to dump into what file?

well, i still don't have it working the way i want, but in add_comment.php i'm adding the mail function between the save and dismiss functions like helpful vallimar mentioned.

<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
$gallery->album->save();
mail("me@my_domain.com", "gallery comment", "$comment_text - $commenter_name", "From: an_email_address");
dismissAndReload();
</TD></TR></TABLE><!-- BBCode End -->

 
castelijn

Joined: 2002-09-17
Posts: 11
Posted: Tue, 2002-09-17 23:13

This looks to me like too much manually done. Isn't it possible to send an email to the owner of the album automatically when a user's comment has been added saying something along the lines of

From: Gallery webalum ("webmaster@yourdomain.com")
To: $album_ownername ($ownername_email)
Subject: New comment in Gallery
Tekst: There is a new comment for you, $album_ownername. It says $comment_made". Click $album_url to view the picture and the comment.

Note: I'm just making all the $[string] up but it shouldn't be too difficult.

Without actually getting into the detail myself, I would be interested in the code from anyone who managed to get this to work as I haven't programmed for ages... and don't have the time either. Well I might have to make time if nobody wants to do it :razz:

Thanks to "the one" (c)The Matrix :wink:
Maurice

 
drewdomkus

Joined: 2002-09-06
Posts: 7
Posted: Wed, 2002-09-18 14:24

i wish it was that simple...
$album_url does nothing as it is not a valid variable.

i can only get the comment and commenter_name to relay any useful info through the email.

 
mnstrgns
mnstrgns's picture

Joined: 2002-10-11
Posts: 2
Posted: Sat, 2002-10-12 16:59

hey folks - this is a mod of code that was posted by POWER in a different thread
I modified it and tested pretty successfully...

this section of code replaces the all the code before the first HEAD tag in tha add_comment.php file

<?
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violationn";
exit;
}
?>
<? require($GALLERY_BASEDIR . "init.php"); ?>
<?
// Hack check

if (strcmp($gallery->album->fields["public_comments"], "yes")) {
exit;
}

$error_text = "";

if (!strcmp($submit, "Save")) {
if ($commenter_name &amp;&amp; $comment_text) {
$text = stripslashes($comment_text);
$text_url = urlencode($text);

/*mail for post control of comment in gallery*/
$email_admin="you@yourdomain.com";
$email_postmaster="you@yourdomain.com";
$headers="Return-Path: ".$email_postmaster."rn";
$headers.="From: ".$email_admin."rn";
$subject="Comment added by ".$commenter_name." to the gallery";

$date = date("d/m/Y");
$time = time("B / D d / j-m-Y / H:i:s");
$temps = getdate($time);
$dns = gethostbyaddr($REMOTE_ADDR);

$contents="
Summary of comment information:
Name : $commenter_name
IpNumber : $IPNumber
Comment : $text
Photo :
http://www.YOURDOMAIN.com/gallery/search.php?searchstring=$text_url

Recording carried out $date at $temps[hours]h$temps[minutes]m
by $REMOTE_ADDR
$dns with $HTTP_USER_AGENT ";
mail("you@yourdomain.com", $subject, $contents, $headers);

$comment_text = removeTags($comment_text);
$commenter_name = removeTags($commenter_name);
$gallery->album->addComment($index, stripslashes($comment_text), $IPNumber, $commenter_name);
$gallery->album->save();
dismissAndReload();
return;
} else {
$error_text = "Name and Comment are both required to save a new comment!";
}
}
?>

 
vahan1

Joined: 2002-11-01
Posts: 27
Posted: Sat, 2002-11-02 00:23

Thanks, worked great!!

...except in email From field, it's displayed as "Unknown" ...couldn't figure out how to change that.

thanks!

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2002-11-04 12:10
Quote:
Thanks, worked great!!

...except in email From field, it's displayed as "Unknown" ...couldn't figure out how to change that.

thanks!

The From address should come from the $header. Problem is, the back slashes in the code above have been removed, so the $header is corrupted. Every where you see the word "rn" above, you need to replace it with "\r\n"

From: should then appear in email.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2002-11-04 12:12

Try again as that didn't work.

Replace "rn" with "rn" in the $header lines.

 
vahan1

Joined: 2002-11-01
Posts: 27
Posted: Tue, 2002-11-05 00:57
Quote:
Try again as that didn't work.

Replace "rn" with "rn" in the $header lines.

Thanks Joan!! this worked perfectly. Made me happy!

-v

p.s. i was wondering what the heck those rn's were... :smile:

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Thu, 2002-11-14 01:36

How would I go about getting the variable for the album owner's email address? I would like to have the notification sent to the individual album owners, and not my email address.

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Thu, 2002-11-14 06:44

Definitely great. I just set up member folders for my friends and they asked how they can get comments on their silly pics... I'm not forwarding emails. I don't like them THAT much :lol:

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-14 07:15

$owner = $gallery->album->getOwner();
$owner_name = $owner->getFullName();
$owner_email = $owner->getEmail();

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Thu, 2002-11-14 08:43

Okay, so I'm a bit slow. I'm having problems using that variable in the code posted by mnstrgns above. Do I have to define a new variable, and then use that in mail() to send to that address?

A little help please, thank you.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-14 08:57

Insert the $owner and $owner_email lines above the mail() line. Then replace the "you@yourdomain.com" in the mail() function with $owner_email.

-Beckett (beck@beckettmw.com)

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Thu, 2002-11-14 09:39

Thank you beckett! The user support for Gallery really does set it apart from almost all other open source scripts available.

Thanks again! :lol:

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Thu, 2002-11-14 13:02

Good software ->
happy users ->
enthousiastic users ->
users wanting to share their enthusiasm ->
users giving support ->
bharat happy

right?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-14 13:17

Bharat happy ->
more good software ->
(rinse, repeat as necessary)

Is this what they call a "vicious cycle"? :wink:

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Thu, 2002-11-14 19:54

I wouldn't call it vicious, but I think you got the point.

 
Agatka
Agatka's picture

Joined: 2002-10-19
Posts: 140
Posted: Sat, 2002-11-16 06:12

oops nevermind :wink:

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Thu, 2002-11-21 06:05

Should $owner_name = $owner->getFullName(); output the owner's name? If I enter it in the contents of the message being sent it's skipped over and doesn't output anything.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-21 14:09

Once you put in the "$owner_name = $owner->getFullName();" code, you can use $owner_name as the name. Note that if it's inside a string, then you should use double quotes --> " <-- to enlcose the string to get variable interpolation.

Of course, if someone didn't put in an owner name, it would be blank. This code (pulled from albums.php) will default to the username if the owner name is blank.
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>$owner_name = $gallery->user->getFullname();
if (empty($owner_name)) {
$owner_name = $gallery->user->getUsername();
}</TD></TR></TABLE><!-- BBCode End -->

-Beckett (beck@beckettmw.com)

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Thu, 2002-11-21 18:41

Hmm, I must still be doing something wrong. Do you ever just get sick of certain people, and their questions? :razz:

Here is a snipet of the code added to add_comments.php:

<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> /*mail for post control of comment in gallery*/
$email_admin="MalibuBoatOwners.com";
$email_postmaster="malibubo@malibuboatowners.com";
$headers="Return-Path: ".$email_postmaster."rn";
$headers="From: MalibuBoatOwners.comrn";
$subject="A comment has been added to your MalibuBoatOwners.com gallery.";

$date = date("d/m/Y");
$time = time("B / D d / j-m-Y / H:i:s");
$temps = getdate($time);
$dns = gethostbyaddr($REMOTE_ADDR);

$contents="
Hello $owner_name-

$commenter_name has added the following comment to your MalibuBoatOwners.com Gallery.

--------------------
$text
--------------------

The comment, and associated picture can be viewed by clicking this link:
http://www.malibuboatowners.com/gallery/search.php?searchstring=$text_url

If you find the comment offensive, it may be removed by clicking the delete comment link next to it.

Thanks for using MBO Owner Galleries!";

$owner = $gallery->album->getOwner();
$owner_name = $owner->getFullName();
$owner_email = $owner->getEmail();
mail("$owner_email", $subject, $contents, $headers); </TD></TR></TABLE><!-- BBCode End -->

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2002-11-21 22:49

Okay. Quick PHP lesson: the interpolator can't read your mind. :wink:
The PHP variable interpolator sees your string and gets to
Hello $owner_name-
Well, $owner_name- isn't a variable! So we need to be more explicit
Hello ${owner_name}-
Now the interpolator knows what bit you want as the variable name and what bit you don't want to be included.

-Beckett (beck@beckettmw.com)

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Fri, 2002-11-22 01:30

Well shoot, that didn't work either. Oh well, thanks alot for your help beckett, I really do appreciate it. :razz:

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2002-11-22 01:46

Well... if you supply the error, then I'll help you figure it out. I still don't really know what's going wrong...

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Fri, 2002-11-22 03:25

I'm no expert but in the code he posts, $owner_name gets defined after it is called in the code. Does that matter?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2002-11-22 03:40

Good catch!! Yep. It most certainly matters!

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Fri, 2002-11-22 05:19

Thanks, I had a hunch. Glad to help, hopefully that fixes it all. :smile:

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Sun, 2002-11-24 04:22

Hi,
I m having trouble with the long code posted on page 1.
the add comment page loads up, I can add a comment, and when I press add, I m taken to a page that says, the server made a boo boo.
However, I do receive the email notification correctly...
you can check out the code in http://photos.lost-oasis.net/gallery/add_comment.txt
Thanksssss.
p

 
josephp

Joined: 2002-10-03
Posts: 172
Posted: Sun, 2002-11-24 04:24

OK how I can install this, I cant get it to work

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Sun, 2002-11-24 18:38

2 questions...

1- is there a better place to get the script of 5 latest pictures than at transitgallery.com cos the scripts seem full of character that are bugging the code like font tags and others... maybe I ll try to download from another browser. and see...
2- I have put the line <? include ("http://photos.lost-oasis.net/gallery/last-updates.php")?> at the very end of my index.php in the gallery folder but it doesn t do anything, the page just seem to load forever... Was that the right thing to do or not?
you can check http://photos.lost-oasis.net/gallery/index2.php to see
Thanks
p
SORRY POSTED IN WRONG THREAD.
STARTED A NEW ONE.

 
josephp

Joined: 2002-10-03
Posts: 172
Posted: Sun, 2002-11-24 20:27
Quote:
2 questions...

1- is there a better place to get the script of 5 latest pictures than at transitgallery.com cos the scripts seem full of character that are bugging the code like font tags and others... maybe I ll try to download from another browser. and see...
2- I have put the line <? include ("http://photos.lost-oasis.net/gallery/last-updates.php")?> at the very end of my index.php in the gallery folder but it doesn t do anything, the page just seem to load forever... Was that the right thing to do or not?
you can check http://photos.lost-oasis.net/gallery/index2.php to see
Thanks
p

What did you do? THe page loads forever, did you mean to put the inculde in gallery's index.php?

if that so, dont put in there, it wont work that way ...

Did you like the way I setup the stuff on my website (www.transitgallery.com)

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Mon, 2002-11-25 00:02

First of all, thanks you for your help! You would think I would have at least spotted that error. Anyway, thank you for helping me get it up and running.

pbyjp- If you enter the URL to the to the last 5 pictures script, does it load correctly? It sounds like the strange characters in the code are screwing with how browser reads it.

Does anyone know how hard it would be to re-organize things so the add comment form is included in view_photo.php below the photo?

 
samlewit

Joined: 2002-10-12
Posts: 37
Posted: Fri, 2002-12-13 20:11

On the comment e-mail notification code posted on page 1 of this thread. Thanks for the mod. I installed it and it works perfectly! Nice solution to the problem.

Thanks again

 
samlewit

Joined: 2002-10-12
Posts: 37
Posted: Sun, 2002-12-15 19:35

Actually, I spoke too soon. I just got 4 comments and it only worked on one. It craps out if the comment is too long or if the comment has weird characters in it.

I think if the mod took just the first 5 words, and filtered out everything but alphanumerics, it would work. Anyone know how to do that?

 
Russ(Austin)

Joined: 2002-12-03
Posts: 14
Posted: Mon, 2003-01-20 20:07

Note: Windows users need to set some variables in php.ini for the mail() function to work:

SMTP = your-smtp-server.com;
sendmail_from =

;

 
tuna

Joined: 2003-01-18
Posts: 21
Posted: Mon, 2003-01-20 23:24

What about including the picture the user is commenting about along with the comments in the e-mail, instead of a link? Can someone tackle that?

 
Jigzaw

Joined: 2003-02-10
Posts: 7
Posted: Mon, 2003-02-10 15:01

I have implemented the long code snippet on page one, added the variabals for different album owners etc but there's no e-mails showing up in my inbox. What am I doing wrong? :???:
Here's the code:<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
<?
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violationn";
exit;
}
?>
<? require($GALLERY_BASEDIR . "init.php"); ?>
<?
// Hack check

if (strcmp($gallery->album->fields["public_comments"], "yes")) {
exit;
}

$error_text = "";

if (!strcmp($submit, "Save")) {
if ($commenter_name &amp;&amp; $comment_text) {
$text = stripslashes($comment_text);
$text_url = urlencode($text);

/*mail for post control of comment in gallery*/
$email_admin="snegleposten@hotmail.com";
$email_postmaster="snegleposten@hotmail.com";
$headers="Return-Path: ".$email_postmaster."
";
$headers.="From: ".$email_admin."
";
$subject="Comment added by ".$commenter_name." to the gallery";

$date = date("d/m/Y");
$time = time("B / D d / j-m-Y / H:i:s");
$temps = getdate($time);
$dns = gethostbyaddr($REMOTE_ADDR);

$contents="
Summary of comment information:
Name : $commenter_name
IpNumber : $IPNumber
Comment : $text
Photo :
http://www.YOURDOMAIN.com/gallery/search.php?searchstring=$text_url

Recording carried out $date at $temps[hours]h$temps[minutes]m
by $REMOTE_ADDR
$dns with $HTTP_USER_AGENT ";
$owner = $gallery->album->getOwner();
$owner_name = $owner->getFullName();
$owner_email = $owner->getEmail();
mail("$owner_email", $subject, $contents, $headers);

$comment_text = removeTags($comment_text);
$commenter_name = removeTags($commenter_name);
$gallery->album->addComment($index, stripslashes($comment_text), $IPNumber, $commenter_name);
$gallery->album->save();
dismissAndReload();
return;
} else {
$error_text = "Name and Comment are both required to save a new comment!";
}
}
?>
</TD></TR></TABLE><!-- BBCode End -->
Code also availebel at http://gomslork.pcplayground.com/gallery/add_comment.php.txt

 
pbyjp
pbyjp's picture

Joined: 2002-11-12
Posts: 260
Posted: Fri, 2003-03-07 15:04

Found a bit of code sitting in <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=1103&amp;4062" TARGET="_blank">this thread</A><!-- BBCode End --> which I thought would be interesting.
In the email you get, it replaces the search link to the picture commented, with a link straight to the picture itself.
It was a collab between POWER, ajs279 and Beckett.
Thanks to them again.
Check the thread.

Also for those of you interestd in the email notification, smbd else did a little hack.
Check out <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=3069" TARGET="_blank">his thread</A><!-- BBCode End -->.
just cross-referencing. :wink:
p

 
CarrieCasketCrew

Joined: 2003-05-13
Posts: 6
Posted: Thu, 2003-05-15 11:31

I did everything that was said to do on the thread here, but I keep getting a parse error when I delete all the code before the <head> code. What is wronge with my code? Can anyone help. Thanks :D



<?php
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violation\n";
exit;
}
?>
<?php require($GALLERY_BASEDIR . "init.php"); ?>
<? 
// Hack prevention. 
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || 
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || 
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { 
print "Security violationn"; 
exit; 
} 
?> 
<? require($GALLERY_BASEDIR . "init.php"); ?> 
<? 
// Hack check 

if (strcmp($gallery->album->fields["public_comments"], "yes")) { 
exit; 
} 

$error_text = ""; 

if (!strcmp($submit, "Save")) { 
if ($commenter_name && $comment_text) { 
$text = stripslashes($comment_text); 
$text_url = urlencode($text); 

/*mail for post control of comment in gallery*/ 
$email_admin="webmaster@casketcrew.com"; 
$email_postmaster="webmaster@casketcrew.com"; 
$headers="Return-Path: ".$email_postmaster."/r/n"; 
$headers.="From: ".$email_admin."/r/n"; 
$subject="Comment added by ".$commenter_name." to the gallery"; 

$date = date("d/m/Y"); 
$time = time("B / D d / j-m-Y / H:i:s"); 
$temps = getdate($time); 
$dns = gethostbyaddr($REMOTE_ADDR); 

$contents=" 
Summary of comment information: 
Name : $commenter_name 
IpNumber : $IPNumber 
Comment : $text 
Photo : 
http://www.casketcrew.com/gallery/searc ... =$text_url <http://www.casketcrew.com/gallery/search.php?searchstring=$text_url> 

Recording carried out $date at $temps[hours]h$temps[minutes]m 
by $REMOTE_ADDR 
$dns with $HTTP_USER_AGENT "; 
mail("you@yourdomain.com", $subject, $contents, $headers); 

$comment_text = removeTags($comment_text); 
$commenter_name = removeTags($commenter_name); 
$gallery->album->addComment($index, stripslashes($comment_text), $IPNumber, $commenter_name); 
$gallery->album->save(); 
dismissAndReload(); 
return; 
} else { 
$error_text = "Name and Comment are both required to save a new comment!"; 
} 
} 
?> 


<html>
<head>
  <title>Add Comment</title>
  <?php echo getStyleSheetLink() ?>
</head>
<body>

<center>
Enter your comment for this picture in the text
box below.
<br><br>
<?php echo $gallery->album->getThumbnailTag($index) ?>
<?php
if ($error_text) {
?>
<br><br>
<span class=error><?php echo $error_text?></span>
<br><br>
<?php
}
?>

<?php echo makeFormIntro("add_comment.php", array("name" => "theform", "method" => "POST")); ?>
<input type=hidden name="index" value="<?php echo $index ?>">
<input type=hidden name="IPNumber" value="<?php echo $HTTP_SERVER_VARS['REMOTE_ADDR'] ?>">
<table border=0 cellpadding=5>
<tr>
  <td>Name or email:</td>
  <td><input name="commenter_name" value="<?php echo $commenter_name?>" size=30></td>
</tr>
<tr>
  <td colspan=2><textarea name="comment_text" rows=5 cols=40><?php echo $comment_text?></textarea></td>
</tr>
</table>
<br>
<input type=submit name="submit" value="Save">
<input type=button value="Cancel" onclick='parent.close()'>

</form>

<script language="javascript1.2">
<!--   
// position cursor in top form field
document.theform.commenter_name.focus();
//-->
</script>

</body>
</html>
 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-05-15 11:41
 
CarrieCasketCrew

Joined: 2003-05-13
Posts: 6
Posted: Thu, 2003-05-15 11:53

Thanks Joan. I am new to this...and yes sometimes I can be a little lazy *grins*

 
Nos402

Joined: 2003-06-26
Posts: 15
Posted: Fri, 2003-08-01 14:16

When I implement the code on page one, I get this error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /[my home directory]/gallery/add_comment.php:10) in /[my home directory]/gallery/session.php on line 51

However I can still enter the comment and it still gets emailed to me also, so everything seems to work, but I would like to get rid of that error at the top of the page. Any ideas?