Building an On-Rev Guest Book

Sarah Reichelt sarah.reichelt at gmail.com
Fri Aug 28 19:38:15 EDT 2009


Does the form work in the end i.e. does the new entry get added to
your guest book text file?
If so, then the only problem is that things are happening in the wrong order.

You ned to check for POST data, and if it's there, save it to the text file.
Then you need another section of irev code that reads the text file
and displays it.
If these are done in the opposite order, then you won't see the changes.

Cheers,
Sarah

P.S. If you like to send me your file off-list, I'd be happy to take a
look at it and see if I could suggest a fix.



On Sat, Aug 29, 2009 at 1:17 AM, Gregory
Lypny<gregory.lypny at videotron.ca> wrote:
> Thanks for responding, Sarah.
>
> Tried that but it doesn't work.  The page displays the result of the
> form.irev code as it would be before the form is processed even if the form
> is filled and the submit button clicked.  Perhaps I misunderstood your
> instructions.  I changed
>
>        "http://myAccount.on-rev.com/form.irev"
>
> in the form action in 2 below to
>
>        "http://localhost/mySiteFolder/thePage.html"  (Site folder on my Mac)
>
> I then put another HTML snippet on the page with the irev code
>
>        <iFrame src="http://pareto.on-rev.com/form.irev">
>
> I also tried to upload the web site from my Sites folder to my www folder at
> On-Rev using the Web Disk, but I kept getting an error.  Sigh.
>
>        Gregory
>
>
>
>
> On 28-Aug-09, at 3:16 AM, Sarah wrote:
>
>> Instead of posting the form data to a separate file, post it back to
>> the file containing the form itself and have it read the post data,
>> save it and then display it all in the one file.
>>
>> So put the script you have in form.irev into an HTML snippet on the
>> original page. Then change the form action to point to whatever you
>> have called that file.
>>
>> For some On-Rev examples, check out my page at http://www.troz.net/onrev/
>>  especially the Simple Form script.
>>
>> Cheers,
>> Sarah
>>
>>
>> Sent from my iPhone
>>
>> On 28/08/2009, at 7:23 AM, Gregory Lypny <gregory.lypny at videotron.ca>
>> wrote:
>>
>>> Hello everyone,
>>>
>>> Well, I've made some progress with this whole On-Rev thing.  I'm
>>> trying to reproduce Kevin Miller's video example of guest book form
>>> that echoes the entry and save it to a file except that I want to do
>>> it using an HTML snippet object in an iWeb page that I've got served
>>> from my Mac in the Sites folder.  I think the HTML snippet works
>>> like an iFrame but I'm not sure if they are the same thing.  Man,
>>> that was a mouthful and probably a pain to read, but it's just the
>>> three parts listed below.
>>>
>>> Everything works fine except that the entry is echoed in a new
>>> (blank) window rather than tacked onto the original form page as in
>>> Kevin's example.  Can anyone tell me how I can get the entry to echo
>>> in the original form?
>>>
>>> Much obliged,
>>>
>>>  Gregory
>>>
>>> 1.  An iWeb site served from my Mac's Sites folder
>>>
>>> 2.  One of the pages has the following HTML snippet:
>>>
>>> <form action="http://myAccount.on-rev.com/form.irev"  method="post">
>>>  -- Kevin's web form HTML code copied here
>>> </form>
>>>
>>> 3.  The form.irev file referred to in the snippet in 2 above has the
>>> following code that processes the form.
>>>
>>> <html>
>>>
>>> <?rev
>>> put $_POST["name"] into theName
>>> put $_POST["age"] into theAge
>>> put $_POST["email"] into theEmail
>>>
>>> if theName is not empty
>>> then
>>>
>>> put theName & tab & theAge & tab & theEmail & return \
>>> after url ("file:testGuestBook.txt")
>>>
>>> put "YOUR REGISTRATION" & "</br>"
>>> put "Name:" && theName & "</br>"
>>> put "Age:" && theAge & "</br>"
>>> put "eMail:" && theEmail & "</br>"
>>> put  "</br>" & "</br>"
>>> put "OTHER REGISTRANTS" & "</br>"
>>> put url ("file:testLogin.txt")
>>> else
>>> put "NO NAME!"
>>> end if
>>>
>>> ?>
>>>
>>> </html>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list