Determine What Is Passed On A Webpage

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Determine What Is Passed On A Webpage

Post by warrenk » Wed Apr 22, 2009 1:04 pm

This may be a stupid question...

I have a PHP webpage with a form. I want to be able to use Rev Studio to mimick the form on the PHP page. My question is....how can I determine what parameters are passed when the form is posted?

Thanks!
Warren

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Wed Apr 22, 2009 1:33 pm

Can we have a little more info about how you are using Rev to "mimick" the web form?
Do you mean you are creating a standalone with a similar function?
Or trying to use Rev offline to then populate the webform?
If you are trying to fill in fields in Rev and then have Rev post the form data to the url, then you will want to look up something like the libUrlFormData function in the dictionary. The data that you need to post will be something you can determine from the source code of the web page.
If you look at the source for the <form> element, then check everything between the opening tag and the closing </form> tag and find everything that has a value. Input types may be text, or hidden, or option selections etc so it is something you may need to delve for.
If you use Firefox, you can get the addon "LiveHTTPHeaders" which you can set to show in the sidebar and in realtime it will display all the transactions between server and client. From this you can see what data is posted to the web form at the appropriate point. (Try clearing the view just before pressing the submit button on the form, and then looking at the headers in the sidebar pane, which should make it easy to find what's been posted.)
You may also find that you need to manage any session cookies if people need to be logged in and user authenticated before submitting a form. That is also possible but needs some more work to manage to discover what cookie headers are submitted in each direction, and will involve checking libURLLastRHHeaders to see what has been set. You would then need to use httpHeaders and/or libURLSetCustomHTTPHeaders to submit the correct cookie data to preserve the authenticated session.
I don't know if any of that's helpful or relevant to your task, but HTH.

warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Post by warrenk » Wed Apr 22, 2009 1:40 pm

Sparkout,

I am trying to create a standalone application with similar function. It looks like the libUrlFormData (along with your explanation of the input fields) will be my solution.

I will check out the LiveHTTPHeaders with FireFox. This would be very helpful.

Thanks for pointing me in the write direction. You help was very informative! Really Appreciate it!

Warren

Post Reply