Webmastersite.net
Register Log In

formemail.phpnot working

Comments on formemail.phpnot working

Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted May 02, 2005 - 9:40 AM:

I'm trying to set up a contact page using formemail.php. When testing, everything works except that it doesn't email the message itself. It sends an email with FROM, SUBJECT, but no MESSAGE. Looking at formemail.php (I only have limited php knowledge, so if I am wrong, don't fault me), I didn't see anywhere that the message value is getting passed and posted.

My contact.php file:


<?php
$custom = 'yes';
$TID = 'contact';
require 'index.php';
?>


My contact.tpl file:

<table width="95%" border="0" cellpadding="1" cellspacing="1" bgcolor="#0099FF" class="maintext">
<tr bgcolor="#FFFFFF">
<form action="formemail.php" method="post">
<input type="hidden" name="thankspage" value="http://www.gamelinks.com">
<td valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#2498C1" class="maintext">
<tr>
<td bgcolor="#2498C1" class="footertext"><strong><a href="https://www.webmastersite.net/forums/">{LANG_NAVORIGIN}</a> > <font color="#E1E6E6">Contact Webmaster</font></strong></td>
</tr>
<tr bgcolor="#FFFFFF">
<td class="boxcolor"><table width="100%" border="0" cellpadding="3" cellspacing="0" class="maintext">
<tr>
<td><strong>Your E-mail:</strong></td>
<td><input type="text" name="submitteremail" size="{STANDARDSIZE}"></td>
</tr>
<tr>
<td><strong>Subject:</strong></td>
<td><input type="text" name="subject" size="{STANDARDSIZE}"></td>
</tr>
<tr>
<td valign="top"><strong>Message:</strong></td>
<td><textarea name="message" cols="30" rows="10"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Send E-Mail" class="button"></td>
</tr>
</table></td>
</form>
</tr>
</table>
</td></tr></table>


BTW, notice how it fills in the variables in the above code with your forum URL - could there be a potential security risk in allowing that to occur with your forum?

Thanks,
Adam
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 03, 2005 - 4:37 PM:

Testing {DIRURL} here. I can't figure out where in the world the https://www.webmastersite.net/forums/ you have is coming from.

Anyhow, it's possible that 'message' is a value that gets interfered with somewhere in start.php, so you could try another variable name.
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted May 04, 2005 - 11:52 PM:

Nope, changed the "message" variable to "mymessage" and it still doesn't work. Emails all the entered info except for that one.
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted May 10, 2005 - 7:01 PM:

Just wondering if you are able to duplicate this problem through your demo of WSN Links.

-Adam
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 10, 2005 - 9:02 PM:

Confirmed, it needs a

reset($_POST);

above

while(list($key, $value) = each($_POST))
Synozeer
Forum Regular

Usergroup: Customer
Joined: Jun 02, 2004

Total Topics: 32
Total Comments: 142
Posted May 10, 2005 - 9:18 PM:

That fixed it.

I noticed that for every blank line in the message I type, it puts two blank lines in the email I receive. Is this something fixable?

Adam
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 12, 2005 - 3:02 AM:

Probably not, since the posted text isn't being altered in any way and it's showing the correct number of line breaks for me in my test. Maybe some differce between your email client and browser in dealing with line breaks, or something related to unix/windows differences.

asd@sdfd.com has filled out a form with this content:


subject: test line breaks

message: Hi.
This is a second line.

This is the fourth line.

The sixth.
The seventh.


The tenth. Okay?
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.