Thread: Forms within E-mail
Results 1 to 14 of 14
Related
-
Please Help Me - CGI Mail Form Forum: CGI Perl Forum
Replies: 1 -
Help, form mail Forum: PHP Forum
Replies: 0 -
php mail script help Forum: PHP Forum
Replies: 14 -
E-mail to a friend Form Forum: HTML Forum
Replies: 5
-
07-16-2003, 02:07 PM #1
Forms within E-mail
Here's what I'm trying to do. It may not be possible, but I seem to be close so I wanted to see if I was overlooking something. I have a form which submits an e-mail to me. Within this e-mail is another form with the same information, but allowing me, the webmaster to Accept or Deny the information.
I would like to be able to use Accept and Deny buttons (previously the information was sent and I entered it manually if I accepted it) so that it would be a quicker process and I wouldn't be able to make mistakes retyping the input.
The first part, the original form which send the e-mail works fine (members2.php). I get the e-mail with the embedded form, but the buttons don't work. Here's the html form within the e-mail (testemailapp.php):
$body="<H2>Accept/Deny New Member</H2><form name=\"adddenyuser\" enctype=\"multipart/form-data\" method=\"post\" action=\"http://www.wku.edu/gg/users2.php\"><table><tr><td><FONT SIZE=\"4\">Account Information</FONT><br><table><tr><td>Real Name:</td><td> <input type=\"text\" name=\"name\" value=\"$name\";></td></tr><tr><td>User ID:</td><td> <input type=\"text\" name=\"userid\" value=\"$userid\";></td></tr><tr><td>Password:</td><td> <input type=\"password\" name=\"pass1\" value=\"$password\";></td></tr></table></td><td><FONT SIZE=\"4\">Member Details</FONT><br>Phone Number: <input type=\"text\" name=\"newphone\" value=\"$phone\";><br><input type=\"checkbox\" name=\"newphoneshow\" value=\"1\" $sphone>Show Phone Number on Members page<br>E-mail Address: <input type=\"text\" name=\"mail\" value=\"$email\";><br><input type=\"checkbox\" name=\"mailshow\" value=\"1\" $semail>Show E-mail Address on Members page<br><input type=\"checkbox\" name=\"memlev\" value=\"1\" $sofficer>Officer?<br></td></tr><tr><td><input type=\"submit\" name=\"Accept\" value=\"Accept\"></td><td><input type=\"submit\" name=\"Deny\" value=\"Deny\"></td></tr><tr>For record purposes, the password is: $password</tr></table>";
mail("bowdemc@wku.edu", "Accept/Deny Web Membership", "$body");
<?php
if($remove)
{
remove($remuser);
?>
<script language="javascript">
location.replace("<?php echo $PHP_SELF; ?>");
</script>
<meta http-equiv="refresh" content="0; url=<?php echo $PHP_SELF; ?>">
<?php
}
if($replace)
{
remove($userid);
if($pass1 != $pass2)
{
echo "Re-enter password information and submit again";
}
else
{
$fp = fopen("/export/htdocs/Dept/Org/Student/wkugg/members/users.txt", "a");
//$fp = fopen("users.txt", "a");
fwrite($fp, "\n");
fwrite($fp, $userid);
fwrite($fp, ":");
fwrite($fp, $pass1);
fwrite($fp, ":");
fwrite($fp, $name);
fwrite($fp, ":");
fwrite($fp, $mail);
fwrite($fp, ":");
if($mailshow)
{
fwrite($fp, "1");
}
else
{
fwrite($fp, "0");
}
fwrite($fp, ":");
fwrite($fp, $newphone);
fwrite($fp, ":");
if($newphoneshow)
{
fwrite($fp, "1");
}
else
{
fwrite($fp, "0");
}
fwrite($fp, ":");
if($memlev == 1)
{
fwrite($fp, "officer");
}
else
{
fwrite($fp, "member");
}
fwrite($fp, ":");
fclose($fp);
}
?>
<script language="javascript">
location.replace("<?php echo $PHP_SELF; ?>");
</script>
<meta http-equiv="refresh" content="0; url=<?php echo $PHP_SELF; ?>">
<?php
}
if($Submit)
{
if($pass1 != $pass2)
{
echo "Re-enter password information and submit again";
}
else
{
$fp = fopen("/export/htdocs/Dept/Org/Student/wkugg/members/users.txt", "a");
//$fp = fopen("users.txt", "a");
fwrite($fp, "\n");
fwrite($fp, $userid);
fwrite($fp, ":");
fwrite($fp, $pass1);
fwrite($fp, ":");
fwrite($fp, $name);
fwrite($fp, ":");
fwrite($fp, $mail);
fwrite($fp, ":");
if($mailshow)
{
fwrite($fp, "1");
}
else
{
fwrite($fp, "0");
}
fwrite($fp, ":");
fwrite($fp, $newphone);
fwrite($fp, ":");
if($newphoneshow)
{
fwrite($fp, "1");
}
else
{
fwrite($fp, "0");
}
fwrite($fp, ":");
if($memlev == 1)
{
fwrite($fp, "officer");
}
else
{
fwrite($fp, "member");
}
fwrite($fp, ":");
fclose($fp);
}
if($Accept)
{
$fp = fopen("/export/htdocs/Dept/Org/Student/wkugg/members/users.txt", "a");
//$fp = fopen("users.txt", "a");
fwrite($fp, "\n");
fwrite($fp, $userid);
fwrite($fp, ":");
fwrite($fp, $pass1);
fwrite($fp, ":");
fwrite($fp, $name);
fwrite($fp, ":");
fwrite($fp, $mail);
fwrite($fp, ":");
if($mailshow)
{
fwrite($fp, "1");
}
else
{
fwrite($fp, "0");
}
fwrite($fp, ":");
fwrite($fp, $newphone);
fwrite($fp, ":");
if($newphoneshow)
{
fwrite($fp, "1");
}
else
{
fwrite($fp, "0");
}
fwrite($fp, ":");
if($memlev == 1)
{
fwrite($fp, "officer");
}
else
{
fwrite($fp, "member");
}
fwrite($fp, ":");
fclose($fp);
}
if($Deny)
{
mail("$mail", "Dear $name, \n \n I'm sorry, but you have been denied by the Webmaster to be added to the WKU Gamers' Guild website. This could be for many reasons. \n \n 1. You could have included insufficient information. Did you remember to include your full name, a valid e-mail, or other incorrect information. Please e-mail the Webmaster for more information or wait until the next meeting. \n 2. No record of you having ever been to a WKU Gamers' Guild meeting. We prefer to meet people before adding them to our website. After a meeting or two feel free to submit your form again (and try to make sure that your name is noted by the officers so that we will know who you are when you try again). \n 3. Any reason that has not be mentioned above, including officer discretion and technical errors. When you are unsure, then it is best to e-mail the Webmaster for more information. \n \n For more information, please contact the Webmaster at bowdemc@wku.edu.");
}
?>
I know that this is a long post, but I wanted to provide as much information as possible. Any help/suggestions that anyone has would be much appreciated. I can't figure out why those buttons aren't working.
-Maria
-
07-16-2003, 03:25 PM #2
We always prefer all the information, dont worry about a long post
Welcome to the forums Maria.
The base of the problem seems to be that the form in the email does not work. I notice that there is no </form> tag, try adding one and see if it works.If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
07-16-2003, 03:26 PM #3
Oh, and by-the-way, that form within the email is a great timesaving idea. I will be borrowing that one
If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
07-16-2003, 03:38 PM #4
Originally Posted by QuietDean
Well, I added the end form tag, and it's still not working. I click the buttons and it's almost like there's no code there. I don't even get an error message.
-
07-16-2003, 04:01 PM #5
Another note, while it views, even if the buttons don't work, with my university webmail, it won't with others. Within Outlook Express and Hotmail it showed the block of coding for the form, but did not run the coding. I tried changing the security settings, but it didn't affect Outlook, and I have no idea how to change anything like that for Hotmail (or even if it's possible).
here's the block of code, I was testing with random information with only my email address being real to test the deny feature:
<H2>Accept/Deny New Member</H2><form name="adddenyuser" enctype="multipart/form-data" method="post" action="http://www.wku.edu/gg/users2.php"><table><tr><td><FONT SIZE="4">Account Information</FONT><br><table><tr><td>Real Name:</td><td> <input type="text" name="name" value="again and";></td></tr><tr><td>User ID:</td><td> <input type="text" name="userid" value="again";></td></tr><tr><td>Password:</td><td> <input type="password" name="pass1" value="more";></td></tr></table></td><td><FONT SIZE="4">Member Details</FONT><br>Phone Number: <input type="text" name="newphone" value="524-5646";><br><input type="checkbox" name="newphoneshow" value="1" checked>Show Phone Number on Members page<br>E-mail Address: <input type="text" name="mail" value="mariebowden@hotmail.com";><br><input type="checkbox" name="mailshow" value="1" >Show E-mail Address on Members page<br><input type="checkbox" name="memlev" value="1" >Officer?<br></td></tr><tr><td><input type="submit" name="Accept" value="Accept"></td><td><input type="submit" name="Deny" value="Deny"></td></tr><tr>For record purposes, the password is: more</tr></table></form>Last edited by Arcania; 07-16-2003 at 04:07 PM.
-
07-16-2003, 04:57 PM #6
ahha. try adding this code to the mailer script -
Code:$headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
Code:mail("bowdemc@wku.edu", "Accept/Deny Web Membership", "$body", $headers);
let us know if it worksIf one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
07-16-2003, 05:15 PM #7
Originally Posted by QuietDean
-
07-16-2003, 05:37 PM #8
Haven't figured it out. I decided to try using a hidden variable that declared a value OnClick, but it didn't seem to work. I've found out that it could be several problems from permissions that are set up on the site for people logged in to variable passing.
Here are my files in progress: http://www.wku.edu/gg/files/TestEmail.zip
The original files are still on the site because I wanted to test them before replacing them.
members2.php 's action points to testemailapp.php instead of sendapp.php.
testemailapp.php has been changed to send html email instead of text email, buttons do not work, though they do display.
users2.php had been changed to remove error messages if you're not logged or if you're not logged on as an officer. Processes the form. Has a form for manually adding on the page. Originally, used if($Accept) format, now using a switch with a variable from Email Form. Doesn't seem to be getting any variables from the email.
I thought that the full files might be easier to look at since other things could be affecting the buttons working.
WHOOPS!Included wrong files in zip file. I reuploaded with the correct files. Sorry about that. Also, fixed one small error where I used different cases on variable values, but still not working.
Last edited by Arcania; 07-16-2003 at 05:50 PM.
-
07-16-2003, 05:50 PM #9
That makes sense, will have a look.
Just a thought, have you condifered using links with querystrings instead of a form? It could be as simple as a form wont submit from within a mail client. i have not found any documentation confirming that, but will have a look at that also.
(it would make sense to me, security)If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
07-16-2003, 05:56 PM #10
Originally Posted by QuietDean
I have heard rumors that it was not possible, but I wanted to try it since I hadn't found any evidence either way.
-
07-16-2003, 05:59 PM #11
It just worked for me
I amended the email address to my own, uploaded to my webspace. When the email arrived I clicked the button and it submitted to http://www.wku.edu/gg/users2.php
Whilst nothing happened @ that page, at least the client works fine.
I am using Mozilla Thunderbird as my mail client. Maybe the problem is with the client?If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
07-16-2003, 06:06 PM #12
Oh, a handy hint to check submitted variables. Add this to the target page -
Code:<? print_r($HTTP_POST_VARS); ?>
If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
07-17-2003, 01:52 PM #13
Originally Posted by QuietDean
Thanks for the help.
-
07-17-2003, 03:04 PM #14
np. Glad its working.
If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum