Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Post vs. Get Tricky Problem

Posted on 2006-11-03
4
Medium Priority
?
261 Views
Last Modified: 2006-12-08
I am trying to automate the passing of variables into a webpage and then grab the returned page via some getHTMl method.

However, it seems the page I am calling requires the variables to be passed in using the post method, but I only know how to pass the variables using the get method and then grab the results in a string...

does anyone have any suggestions on how to get this to run?

thanks,
Marc
0
Comment
Question by:mrferrari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:yeroket
ID: 17871096
can you post your code?
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 17871124
Are you using XML


url = "http://www.the_site.com
 

    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
    xmlhttp.open "POST", url, false
    xmlhttp.send "value=blah&nextvalue=balh"

    status = xmlhttp.status
    if err.number <> 0 or status <> 200 then
        if status = 404 then
            Response.Write "Page does not exist (404)."
        elseif status >= 401 and status < 402 then
            Response.Write "Access denied (401)."
        elseif status >= 500 and status <= 600 then
            Response.Write "500 Internal Server Error on remote site."
        else
            Response.write "Server is down or does not exist."
        end if
    else  
        Response.Write "Server is up and URL is available."  
    end if  
    set xmlhttp = nothing  
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 17872518
when you use get, the variables will be appended on the url, and u get them from the request.querystring object

when u use post, the variables will be in the request.form object

samples!!
1- Using POST
-----------------------------------------------------------------------------------------
<form name="mypostform" action="mypostpage.asp" action="post">
<input type="text" name="myvariable">
<input type="submit" value="submit">
</form>

page: mypostpage.asp

<%
response.write (request.form("myvariable"))
%>

1- Using GET
-----------------------------------------------------------------------------------------
<form name="mygetform" action="mygetpage.asp" action="get">
<input type="text" name="myvariable">
<input type="submit" value="submit">
</form>

page: mygetpage.asp

<%
response.write (request.querystring("myvariable"))
%>


hope this was clear enough...

Cheers,

Dan
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 17872521
sorry in the forms... the second action should be method

<form name="mypostform" action="mypostpage.asp" method="post">
<input type="text" name="myvariable">
<input type="submit" value="submit">
</form>



and


<form name="mygetform" action="mygetpage.asp" method="get">
<input type="text" name="myvariable">
<input type="submit" value="submit">
</form>

cheers,

Dan
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question