Re: semi-OT: can Rev pre-populate data on a web form?

2008-09-11 Thread Chris Sheffield
Just wanted to write and say thanks to Trevor, Ben, and Jim. Using the  
web form is working great. I just needed a little push in the right  
direction, and I got it here. So thanks for the suggestions.


Chris

On Sep 5, 2008, at 3:28 AM, Ben Rubinstein wrote:


Chris Sheffield wrote:
So my main question is, can Rev send data to a web form like this  
in such a way that whatever fields we specify will be populated  
when the browser/form opens? Not sure if something like this is  
even possible. I haven't done enough web development to know. Is  
some special JavaScript required to accomplish this? In thinking  
this through a little more, if we have a web form that's already  
set up to send an email, can't I take advantage of that in Rev by  
creating my own form and then sending the data straight to the cgi  
behind the form? Once again, I haven't done much web dev, so I may  
not even know what I'm talking about. :-)


If anyone can help or can offer any other suggestions for how to
accomplish something similar, it'd be much appreciated.



If I've understood your request correctly, you really want a Rev  
stack to
collect some information from the user, and have it arrive at your  
server in
the form of an email.  There's a simple way to get what you want, I  
think.


Using the SMTP libraries should make this possible, but has some  
issues, in
particular your rev stack then needs to know the address of a mail  
server it
can use from within the user's network to send email.  But if you  
have a web
form on your server that's successfully sending email where you want  
it,

there's no need to open a user's browser to view it.  Instead, Rev can
effectively be that web form.

(Apologies if what follows is teaching my granny to suck eggs.) If  
you look at
the source of the web page, it will contain a "form" element with an  
action
and a method.  The action is the address of a server-side resource  
(a script
etc) which receives the values entered into the form and processes  
it, in this
case by sending an email.  The method is either POST or GET.  If  
it's GET,
then the resource expects the values in the URL string, eg if I fill  
in this

simple form







my browser will next fetch a URL like this:
 ./formmail.cgi?first=Ben&last=Rubinstein

(the first part of the URL being constructed based on the URL of the  
page

holding the form, adjusted by the 'action' of the form.)

Lecture over; the point is that executing

put "./formmail.cgi?first=Ben&last=Rubinstein" into tURL
get URL tURL

or perhaps more likely
put "./formmail.cgi" into tScriptURL
put tScriptURL \
   & "?first=" & tFirstName \
& "&last=" & tLastName \
into tURL
get URL tURL



in your Rev stack will have exactly* the same effect on the  
'formmail.cgi'
resource as the user entering those details into their browser.  At  
this point
Rev is acting like a browser, making a request of the web server.   
So no need

to open an actual browser.

If the form uses the POST method instead, then it's only slightly more
complicated.  Instead of get URL, you need to use the "post"  
command, which

will look something more like this:

put libURLformData("first", tFirstName, "last", tLastName) into tData
post tData to tScriptURL

There will be a few complications along the way; you should read the
(splending new in 3.0) docs, check out functions like URLencode, and  
above
all, test.  But either way, given that you have the web form  
already, this is

probably the simplest route to achieve what you want.

HTH,

- Ben


*pedants please leave now



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: semi-OT: can Rev pre-populate data on a web form?

2008-09-05 Thread Jim Ault
Ben is right on the mark with the 'submit a form' directly from Rev, but one
caveat may be that your website setup software may be using a pre-fab
browser detection script for maximum platform compatibility.  If this is the
case, Revolution will not look like any of the browsers, like FireFox,
Safari, Explorer and it may simply ignore your form submission.

There are ways to deal with this, so post a message if Ben's advice does not
work out.  The browser detection is often done with javascript between the
 tags.  The browser detection is important for Flash content.

Hope your form goes smoothly

Jim Ault
Las Vegas


On 9/5/08 2:28 AM, "Ben Rubinstein" <[EMAIL PROTECTED]> wrote:

> Chris Sheffield wrote:
>> So my main question is, can Rev send data to a web form like this in
>> such a way that whatever fields we specify will be populated when the
>> browser/form opens? Not sure if something like this is even possible. I
>> haven't done enough web development to know. Is some special JavaScript
>> required to accomplish this? In thinking this through a little more, if
>> we have a web form that's already set up to send an email, can't I take
>> advantage of that in Rev by creating my own form and then sending the
>> data straight to the cgi behind the form? Once again, I haven't done
>> much web dev, so I may not even know what I'm talking about. :-)
>> 
>> If anyone can help or can offer any other suggestions for how to
>> accomplish something similar, it'd be much appreciated.
> 
> 
> If I've understood your request correctly, you really want a Rev stack to
> collect some information from the user, and have it arrive at your server in
> the form of an email.  There's a simple way to get what you want, I think.
> 
> Using the SMTP libraries should make this possible, but has some issues, in
> particular your rev stack then needs to know the address of a mail server it
> can use from within the user's network to send email.  But if you have a web
> form on your server that's successfully sending email where you want it,
> there's no need to open a user's browser to view it.  Instead, Rev can
> effectively be that web form.
> 
> (Apologies if what follows is teaching my granny to suck eggs.) If you look at
> the source of the web page, it will contain a "form" element with an action
> and a method.  The action is the address of a server-side resource (a script
> etc) which receives the values entered into the form and processes it, in this
> case by sending an email.  The method is either POST or GET.  If it's GET,
> then the resource expects the values in the URL string, eg if I fill in this
> simple form
> 
> 
> 
> 
> 
> 
> 
> my browser will next fetch a URL like this:
>./formmail.cgi?first=Ben&last=Rubinstein
> 
> (the first part of the URL being constructed based on the URL of the page
> holding the form, adjusted by the 'action' of the form.)
> 
> Lecture over; the point is that executing
> 
> put "./formmail.cgi?first=Ben&last=Rubinstein" into tURL
> get URL tURL
> 
> or perhaps more likely
> put "./formmail.cgi" into tScriptURL
> put tScriptURL \
>  & "?first=" & tFirstName \
>& "&last=" & tLastName \
>into tURL
> get URL tURL
> 
> 
> 
> in your Rev stack will have exactly* the same effect on the 'formmail.cgi'
> resource as the user entering those details into their browser.  At this point
> Rev is acting like a browser, making a request of the web server.  So no need
> to open an actual browser.
> 
> If the form uses the POST method instead, then it's only slightly more
> complicated.  Instead of get URL, you need to use the "post" command, which
> will look something more like this:
> 
> put libURLformData("first", tFirstName, "last", tLastName) into tData
> post tData to tScriptURL
> 
> There will be a few complications along the way; you should read the
> (splending new in 3.0) docs, check out functions like URLencode, and above
> all, test.  But either way, given that you have the web form already, this is
> probably the simplest route to achieve what you want.
> 
> HTH,
> 
> - Ben
> 
> 
> *pedants please leave now
> 
> 
> 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: semi-OT: can Rev pre-populate data on a web form?

2008-09-05 Thread Chris Sheffield
Thanks for the response and good explanation, Ben. This may be exactly  
what I need. I'll be giving it a try today.


Chris


On Sep 5, 2008, at 3:28 AM, Ben Rubinstein wrote:


Chris Sheffield wrote:
So my main question is, can Rev send data to a web form like this  
in such a way that whatever fields we specify will be populated  
when the browser/form opens? Not sure if something like this is  
even possible. I haven't done enough web development to know. Is  
some special JavaScript required to accomplish this? In thinking  
this through a little more, if we have a web form that's already  
set up to send an email, can't I take advantage of that in Rev by  
creating my own form and then sending the data straight to the cgi  
behind the form? Once again, I haven't done much web dev, so I may  
not even know what I'm talking about. :-)


If anyone can help or can offer any other suggestions for how to
accomplish something similar, it'd be much appreciated.



If I've understood your request correctly, you really want a Rev  
stack to
collect some information from the user, and have it arrive at your  
server in
the form of an email.  There's a simple way to get what you want, I  
think.


Using the SMTP libraries should make this possible, but has some  
issues, in
particular your rev stack then needs to know the address of a mail  
server it
can use from within the user's network to send email.  But if you  
have a web
form on your server that's successfully sending email where you want  
it,

there's no need to open a user's browser to view it.  Instead, Rev can
effectively be that web form.

(Apologies if what follows is teaching my granny to suck eggs.) If  
you look at
the source of the web page, it will contain a "form" element with an  
action
and a method.  The action is the address of a server-side resource  
(a script
etc) which receives the values entered into the form and processes  
it, in this
case by sending an email.  The method is either POST or GET.  If  
it's GET,
then the resource expects the values in the URL string, eg if I fill  
in this

simple form







my browser will next fetch a URL like this:
 ./formmail.cgi?first=Ben&last=Rubinstein

(the first part of the URL being constructed based on the URL of the  
page

holding the form, adjusted by the 'action' of the form.)

Lecture over; the point is that executing

put "./formmail.cgi?first=Ben&last=Rubinstein" into tURL
get URL tURL

or perhaps more likely
put "./formmail.cgi" into tScriptURL
put tScriptURL \
   & "?first=" & tFirstName \
& "&last=" & tLastName \
into tURL
get URL tURL



in your Rev stack will have exactly* the same effect on the  
'formmail.cgi'
resource as the user entering those details into their browser.  At  
this point
Rev is acting like a browser, making a request of the web server.   
So no need

to open an actual browser.

If the form uses the POST method instead, then it's only slightly more
complicated.  Instead of get URL, you need to use the "post"  
command, which

will look something more like this:

put libURLformData("first", tFirstName, "last", tLastName) into tData
post tData to tScriptURL

There will be a few complications along the way; you should read the
(splending new in 3.0) docs, check out functions like URLencode, and  
above
all, test.  But either way, given that you have the web form  
already, this is

probably the simplest route to achieve what you want.

HTH,

- Ben


*pedants please leave now



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: semi-OT: can Rev pre-populate data on a web form?

2008-09-05 Thread Ben Rubinstein

Chris Sheffield wrote:
So my main question is, can Rev send data to a web form like this in 
such a way that whatever fields we specify will be populated when the 
browser/form opens? Not sure if something like this is even possible. I 
haven't done enough web development to know. Is some special JavaScript 
required to accomplish this? In thinking this through a little more, if 
we have a web form that's already set up to send an email, can't I take 
advantage of that in Rev by creating my own form and then sending the 
data straight to the cgi behind the form? Once again, I haven't done 
much web dev, so I may not even know what I'm talking about. :-)


If anyone can help or can offer any other suggestions for how to
accomplish something similar, it'd be much appreciated.



If I've understood your request correctly, you really want a Rev stack to
collect some information from the user, and have it arrive at your server in
the form of an email.  There's a simple way to get what you want, I think.

Using the SMTP libraries should make this possible, but has some issues, in
particular your rev stack then needs to know the address of a mail server it
can use from within the user's network to send email.  But if you have a web
form on your server that's successfully sending email where you want it,
there's no need to open a user's browser to view it.  Instead, Rev can
effectively be that web form.

(Apologies if what follows is teaching my granny to suck eggs.) If you look at
the source of the web page, it will contain a "form" element with an action
and a method.  The action is the address of a server-side resource (a script
etc) which receives the values entered into the form and processes it, in this
case by sending an email.  The method is either POST or GET.  If it's GET,
then the resource expects the values in the URL string, eg if I fill in this
simple form







my browser will next fetch a URL like this:
  ./formmail.cgi?first=Ben&last=Rubinstein

(the first part of the URL being constructed based on the URL of the page
holding the form, adjusted by the 'action' of the form.)

Lecture over; the point is that executing

put "./formmail.cgi?first=Ben&last=Rubinstein" into tURL
get URL tURL

or perhaps more likely
put "./formmail.cgi" into tScriptURL
put tScriptURL \
& "?first=" & tFirstName \
& "&last=" & tLastName \
into tURL
get URL tURL



in your Rev stack will have exactly* the same effect on the 'formmail.cgi'
resource as the user entering those details into their browser.  At this point
Rev is acting like a browser, making a request of the web server.  So no need
to open an actual browser.

If the form uses the POST method instead, then it's only slightly more
complicated.  Instead of get URL, you need to use the "post" command, which
will look something more like this:

put libURLformData("first", tFirstName, "last", tLastName) into tData
post tData to tScriptURL

There will be a few complications along the way; you should read the
(splending new in 3.0) docs, check out functions like URLencode, and above
all, test.  But either way, given that you have the web form already, this is
probably the simplest route to achieve what you want.

HTH,

- Ben


*pedants please leave now



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: semi-OT: can Rev pre-populate data on a web form?

2008-09-04 Thread Sarah Reichelt
On Fri, Sep 5, 2008 at 3:58 AM, Chris Sheffield <[EMAIL PROTECTED]> wrote:
> We want our customers to go through a registration process. So the
> standalone would open a url to a form on our web site. The only reason we're
> going to a web form instead of using a form in the application is because we
> want an email message sent to us upon submitting the information. I've
> explored Sarah's smtp library for sending email from Rev, which I'm sure is
> great, but for some reason I can't get it to work. I can't get it to connect
> to our smtp server. Anyway, that's a different topic.


Hi Chris,

In the SMTP Library Demo stack, make sure Verbose logging is turned
on, try connecting and then email me the contents of the log field
off-list. I'll try to work out why you are unable to connect.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: semi-OT: can Rev pre-populate data on a web form?

2008-09-04 Thread Trevor DeVore

On Sep 4, 2008, at 1:58 PM, Chris Sheffield wrote:

So my main question is, can Rev send data to a web form like this in  
such a way that whatever fields we specify will be populated when  
the browser/form opens? Not sure if something like this is even  
possible. I haven't done enough web development to know. Is some  
special JavaScript required to accomplish this?


A simple approach would be to append a query string to the URL you  
open. For example, let's say you want to tell the web form script the  
default first name to use. You could do something like this:


launch url "http://www.mydomain.com/path/to/script.php?first_name=FIRST_NAME

It is then up to the web page (script.php in this case) to look for  
values in the GET query string and then populate the fields with  
default values.


Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution