travisperkins
03-07-2006, 06:19 AM
The attachment for this is with the reply to this post.
A while back, I got a lot of help from the Forum in sorting out the ability to submit user input by email, so that I could use AM6 to create an educational application. This has evolved into being able to also ftp attached and supporting files.
Before posting the project back for those involved in the latter part, I wondered if there was any chance of getting help just sorting out the last few problems with the email part, so that at least that aspect of the functionality is complete. Please feel free to move this to the examples area for others.
Background:
The application has a number of pages, of which the two important ones for these issues are Page 2 (UserDeatailsBasic) and the last Page (Submit).
On Page 2, the Student enters in some information that is written to text files in \\AutoPlay\\Docs
Then, on the last page, when the Student hits '"Submit", this input is sent by email via a sendmail.php script on a remote server.
All is working well. But, I have two issues to resolve:
****
1. In order to get it working so that emails reveal the name of the input filed, in the form of:
Given Name: Peter
Family Name: Smith
instead of just data, in the form of:
Peter
Smith
I added the following code to the 'Save' button on Page 2 that updates the input fields:
sText = Input.GetText("GivenName")
TextFile.WriteFromString("Autoplay\\Docs\\InputGivenName.txt", "Given Name:" .. sText .."\n", false)
sText = Input.GetText("FamilyName")
TextFile.WriteFromString("Autoplay\\Docs\\InputFamilyName.txt", "Family Name:" .. sText .."\n", false)
However, the problem is that the names of the input fields (Given Name, Family Name) actually show up to the Student in the GUI input fields, instead of leaving the input fields blank or populated only with the Student input.
Secondly, this information is followed by a little square that I can not seem to get rid of and that is present even when I omit the name of the input fields from the strings cited above.
Thus, my first two questions are:
1. How can we stop the name of the input fields actually appearing to the Student on Page 2 of the front end?
2. How can we get rid of the little squares in the same place?
****
The other two issues relate to the last Page and the process of Submission.
At the moment, when you hit "Submit", the email is sent, but the Student has no idea at all from watching the screen. Secondly, the user does not receive an email letting them know that their information has been received. Rectifying the first is essential, I think. And if the latter could also be sorted, then that would be a bonus. We have already captured the user's email address on Page 2. Thus:
3. How is it possible to:
A. Show a progress bar while the email is being sent
B. Return an on screen message to confirm to the user that the email has been sent
C. Return an on screen message saying that the user is not connected to the internet if they are not
D. Return an on screen general error message if for some other reason the email is not sent
E. Send an email to the Student confirming their information has been received.
In case it helps, here is the php script as it currently stands:
<?php
$mail_to = $_REQUEST['mail_to'];
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
$mail_from = $_REQUEST['mail_from'];
$reply_to = $_REQUEST['reply_to'];
$headers = "From: $mail_from\r\n";
$headers .= "Reply-To: $reply_to\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
mail(
$mail_to,
$subject,
$message,
$headers
);
?>
A while back, I got a lot of help from the Forum in sorting out the ability to submit user input by email, so that I could use AM6 to create an educational application. This has evolved into being able to also ftp attached and supporting files.
Before posting the project back for those involved in the latter part, I wondered if there was any chance of getting help just sorting out the last few problems with the email part, so that at least that aspect of the functionality is complete. Please feel free to move this to the examples area for others.
Background:
The application has a number of pages, of which the two important ones for these issues are Page 2 (UserDeatailsBasic) and the last Page (Submit).
On Page 2, the Student enters in some information that is written to text files in \\AutoPlay\\Docs
Then, on the last page, when the Student hits '"Submit", this input is sent by email via a sendmail.php script on a remote server.
All is working well. But, I have two issues to resolve:
****
1. In order to get it working so that emails reveal the name of the input filed, in the form of:
Given Name: Peter
Family Name: Smith
instead of just data, in the form of:
Peter
Smith
I added the following code to the 'Save' button on Page 2 that updates the input fields:
sText = Input.GetText("GivenName")
TextFile.WriteFromString("Autoplay\\Docs\\InputGivenName.txt", "Given Name:" .. sText .."\n", false)
sText = Input.GetText("FamilyName")
TextFile.WriteFromString("Autoplay\\Docs\\InputFamilyName.txt", "Family Name:" .. sText .."\n", false)
However, the problem is that the names of the input fields (Given Name, Family Name) actually show up to the Student in the GUI input fields, instead of leaving the input fields blank or populated only with the Student input.
Secondly, this information is followed by a little square that I can not seem to get rid of and that is present even when I omit the name of the input fields from the strings cited above.
Thus, my first two questions are:
1. How can we stop the name of the input fields actually appearing to the Student on Page 2 of the front end?
2. How can we get rid of the little squares in the same place?
****
The other two issues relate to the last Page and the process of Submission.
At the moment, when you hit "Submit", the email is sent, but the Student has no idea at all from watching the screen. Secondly, the user does not receive an email letting them know that their information has been received. Rectifying the first is essential, I think. And if the latter could also be sorted, then that would be a bonus. We have already captured the user's email address on Page 2. Thus:
3. How is it possible to:
A. Show a progress bar while the email is being sent
B. Return an on screen message to confirm to the user that the email has been sent
C. Return an on screen message saying that the user is not connected to the internet if they are not
D. Return an on screen general error message if for some other reason the email is not sent
E. Send an email to the Student confirming their information has been received.
In case it helps, here is the php script as it currently stands:
<?php
$mail_to = $_REQUEST['mail_to'];
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
$mail_from = $_REQUEST['mail_from'];
$reply_to = $_REQUEST['reply_to'];
$headers = "From: $mail_from\r\n";
$headers .= "Reply-To: $reply_to\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
mail(
$mail_to,
$subject,
$message,
$headers
);
?>