PDA

View Full Version : Screen: Email Registration


Brett
10-08-2004, 12:30 PM
Screen: Email Registration
Last Revision: October 8, 2004

Overview
This screen allows you to have your users submit registration information to you during the installation process. The information will be submitted to a PHP script (provided below) which will in turn email the information to you. This screen can easily be modified to include more information, perform data validation, etc. The PHP script can also be easily modified to store the informaiton in a database, etc. As well as being useful in your projects, this screen will also teach you how to:

Use the HTTP.Submit action
Use the Edit Fields screen
Work with strings

Author Information
This screen was created for use by registered owners of Setup Factory 7.0 by Brett Kapilik (http://www.setupfactory.com). Indigo Rose Corporation does not provide support for any 3rd party screens or addons.

Installation Instructions
To make this screen available to your Setup Factory 7.0 projects, follow the steps below:

Close Setup Factory 7.0, if it is running.
Browse to the folder where Setup Factory 7.0 is installed on your system. By default it is C:\Program Files\Setup Factory 7.0.
Locate the "Screens" folder.
Unzip the contents of Email_Registration.zip (see bottom of article) into the Setup Factory 7.0 Screens folder, making sure you preserve the folder structure.
Restart Setup Factory 7.0.
Unzip the file suf7_reg.php from suf7_reg.zip and upload to your Web site.
To use this new screen in your project, select Project > Screens from the main menu and click the Before Installing or After Installing tab. Click the Add button and select "Email Registration" from the screen gallery.
After you have added the screen to your project, edit the On Next event and fill in the appropriate variables.


You should now be able to build and test the screen.

Screen Name: Email Registration
Type: Setup Factory 7.0 Screen
Created By: Brett Kapilik

Comments? Please post them here.

Brett
10-08-2004, 12:31 PM
If anyone is familiar with ASP, please feel free to post an equivalent ASP script here.

cyberops
04-15-2005, 03:41 AM
just a quick question, how do i make it so some fields are required before they can continue ???

thetford
04-19-2005, 03:13 PM
Yes, PLEASE post an autoplay script here! I have setup factory 6.0, could I use this with the earlier version?

thanks,
Mike

DTX
04-28-2005, 11:47 AM
just a quick question, how do i make it so some fields are required before they can continue ???


Yep that would be exactly what I am looking for too.

I need the Hard Drive Serial number emailed to me, so that I may check hosw many machines the application is installed on.

DTX
04-29-2005, 08:46 AM
Further Information on my last post

I can work out how to get the serial number of the hard drive, and indeed all the Hard drive information, I'm having a problem getting that into a means to display it to the person installing, and stating that this information will be sent to us. I need to get the info into a %variable%?

Any help appreciated.

MSokolosky
08-18-2005, 03:07 PM
In the setup it talks about putting the one PHP file on my website......my website is hosted by an external are there any necessary things that I need to know from them or have to tell them or can I just dump it anywhere onto an HTML based website built by frontpage 2003?

Corey
08-18-2005, 03:22 PM
Hi. If the server supports PHP you can just name any file with a .php extension, upload it, and the server will parse it as PHP. If you aren't sure whether or not your server supports PHP try this test script. Simply paste the following code into a text editor and save it as "test.php", then upload it and surf to the uploaded URL through your browser, if you have PHP you will see "Hello World!" and if not you will see all the pasted code "as is". :yes

<?php
echo "Hello World!";
?>

DTX
08-18-2005, 03:27 PM
In the setup it talks about putting the one PHP file on my website......my website is hosted by an external are there any necessary things that I need to know from them or have to tell them or can I just dump it anywhere onto an HTML based website built by frontpage 2003?

If it's a php file, you need to have it in at least the root directory, but probably better in it's own folder,

so you would access it via http://www.yourdomainname.com/foldername/php.file

Root directory is commonly called "public_html" but some servers have other names for it you would need to check with your provider.

To make it work, so long as it's in the same directory as you upload your html files to, it should work.

Remember to configure the php file before you upload it, and i recommentd you do not do this in Microsoft Frontpage but in Notepad. Configure the variables then upload.

Hope that helps

cs200x
09-19-2005, 01:11 PM
I can show you this is my edit version of email screen.

-- Setup some variables.
-- Modify these to fit your situation:
strProductName = SessionVar.Expand("%ProductName%");
strProductVersion = SessionVar.Expand("%ProductVer%");
-- This is the email address that the registrations should be sent to:
strEmailTo = "your_email@domain.net";
-- This is the location of the suf7_reg.php file on your server:
strURL = "http://www.your_domain.net/ur_reg.php";

-- Assemble details into an email message
local strMessage = "";
strMessage = strMessage.."Product: "..strProductName.."\r\n";
strMessage = strMessage.."Product Version: "..strProductVersion.."\r\n";
strMessage = strMessage.."Full Name: "..SessionVar.Expand("%FULL_NAME%").."\r\n";
strMessage = strMessage.."Nick Name: "..SessionVar.Expand("%NICK_NAME%").."\r\n";
strMessage = strMessage.."Country: "..SessionVar.Expand("%COUNTTY%").."\r\n";
strMessage = strMessage.."Email: "..SessionVar.Expand("%EMAIL%").."\r\n";
--We start to add checking fields here
if (SessionVar.Expand("%FULL_NAME%") == "") then
Dialog.Message("Notice", "The Full Name edit field cannot be empty. Please enter a value.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Screen.SetFocus(CTRL_EDIT_02);
elseif (SessionVar.Expand("%NICK_NAME%") == "") then
Dialog.Message("Notice", "The Nick Name edit field cannot be empty. Please enter a value.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Screen.SetFocus(CTRL_EDIT_03);
elseif (SessionVar.Expand("%COUNTTY%") == "") then
Dialog.Message("Notice", "The Country edit field cannot be empty. Please enter a value.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Screen.SetFocus(CTRL_EDIT_04);
elseif (SessionVar.Expand("%EMAIL%") == "") then
Dialog.Message("Notice", "The E-Mail edit field cannot be empty. Please enter a value.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
Screen.SetFocus(CTRL_EDIT_05);
else --End of checking fields
local strSubject = "Registration for "..strProductName;
local strFrom = SessionVar.Expand("%EMAIL%");
local strTo = strEmailTo;

-- Create the table of data to be passed to the PHP script:
local tblValues = {MailTo=strTo,MailFrom=strFrom,MailSubject=strSubj ect,MailMessage=strMessage};

local strResult = HTTP.Submit(strURL,tblValues,SUBMITWEB_POST);
local nLastError = Application.GetLastError();

if((strResult == "OK") and (nLastError == 0))then
Dialog.Message("Status","Registration successful. Thank you.");
-- advance to the next screen
Screen.Next();
else
local nResult = Dialog.Message("Status","Registration failed (#"..nLastError.."). Would you like to try again?",MB_YESNO,MB_ICONQUESTION);
if(nResult == IDNO)then
-- advance to the next screen
Screen.Next();
end
end
end -- we add a end here for the checking fields

I hope that is what you was looking for :)

just a quick question, how do i make it so some fields are required before they can continue ???

huytrantgvn
05-01-2007, 01:00 PM
After i upload the suf7_reg on my host, i open by IE it show me:
Warning: mail() [function.mail]: SMTP server response: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it in C:\Inetpub\vhosts\ytuongnew.com\subdomains\demo\ht tpdocs\suf7_reg.php on line 12
OK

please show me how to fix it.