This looks perfectly translate-able, assuming you have read and edited PHP before. Open up this script in a programmer’s text editor (TextWrangler is free, I use TextMate 1.5, but that’s not free). Unlike a general purpose tool like TextEdit, a programmer’s text editor will highlight different types of code with different colors, and some will show you syntax errors very vividly, too!
Look through the script for each block of PHP code. These begin with <?php and end with ?>, which are known as delimiters. Everything in between those two markers is an executable program. As you move through the script, you will also see the cardinal points of the HTML page that is interwoven into the page. These are mostly not inside of the PHP delimiters (except where there is a loop building a table). The first big block of code appears before the opening tag.
So in Freeway, starting on a new blank page, you open the Page / HTML Markup, switch to Before HTML, and paste in that entire opening block of code, including the PHP delimiters at beginning and end.
Back in your text editor, skip over the HTML that follows until you come to the next bit of PHP. In my reading of this, that would be the action attribute of the form tag. So in Freeway, open up Form Setup, set the Method to GEET, and in the Action field, paste in the relevant bit of PHP: <?php echo $script_name; ?>
Repeat for the e-mail form element. There, you will need to draw (or better, insert into a table cell) a text input. Set the name (third tab of the Inspector) to email and the value to a slight variation on their code. They have the entire value attribute definition within the PHP, but that won’t create valid HTML in Freeway, so you need to change this:
<?php echo " value="$email""; ?>
to this:
<?php echo $email; ?>
and paste that into the Value field in the third tab of the Inspector.
Repeat this process for the firstname and lastname fields, with the equivalent editing in each.
Next in source order is a hidden field for the list ID. In Page / Form Setup, open up the Hidden Fields tab, and click new. The Name is ‘list’ and the value will be <?php echo $list; ?>
Next is the radio buttons for the action you wish to take. This gets fairly complex in Freeway, because the checked attribute needs to be added depending on the value set for that group. I just uploaded a simple Action called RadioFlyer to ActionsForge that will help you here. Create your two radio buttons, naming them both ‘cmd’ and setting their value to ‘subscribe’ or ‘unsubscribe’. Apply RadioFlyer to each of them. That will write out the next bit of PHP for you, so you are nearly there!
The last step is to add the Submit button, and be sure it is named ‘submit’ in the third tab of the Inspector. Whatever you enter in the Value field will become the text on the face of the button.
The last blob of PHP in the page is the error reporting script. Copy that out and in your page, create a Markup Item where you want it to appear. Paste the code into the Markup Item’s code window, then okay it and resize and reposition it to where you want the errors to appear.
At this point, you have to change the filename of the page to end in .php. Do that in the Page Inspector, in the File field on the first tab. Once you do, you won’t be able to preview the page in Freeway or a browser. You will only be able to see it if you upload it to a server that has PHP running and visit that page from its public URL.
Walter
On Feb 13, 2013, at 8:34 AM, Kevin Cheesman wrote:
<?php
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options