473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Submit a form from code

Hi.
I'm given a URL that takes me to a page that looks someting like this:

<html xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<link href="css/default.css" REL="stylesheet">
<body onLoad="document.forms[0].submit()">

<form
action="http://internal-server//login.asp?fds=File&doc=102&current=1&seq=1"
method="post" name="form1">
<input type="hidden" name="username" style="width: 150px" value="test_user">
<input type="hidden" name="password" style="width: 150px" VALUE="test_pass">

<input type="submit" value="Login" style="width: 80px">

</form>
</body>
</html>

When the page loads it automatically logges me onto the system and then
redirects me to a file (pdf, xsl, doc etc). My problem is that I have to
download this file through my code and store it on the web server without a
user interface. Is there someone who can tell me how I can accomplish this?

Thanks,
Shawn
Nov 19 '05 #1
3 1005
Hello Shawn,
You want to do operation idealy performed by your browser. Am I right?
Find class that that allow you to send request and able to grab the
response.
That response will be saved in variable then store it where you want.
I dont know excatly but i think you will get such class in system.net.
happy coading
bhawin13

Nov 19 '05 #2
Hello Shawn,
You want to do operation idealy performed by your browser. Am I right?
Find class that that allow you to send request and able to grab the
response.
That response will be saved in variable then store it where you want.
I dont know excatly but i think you will get such class in system.net.
happy coading
bhawin13

Nov 19 '05 #3
Hi Shawn, as bhawin13 suggested the class you are looking for is
System.Net.HttpWebRequest

jd

"Shawn" wrote:
Hi.
I'm given a URL that takes me to a page that looks someting like this:

<html xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<link href="css/default.css" REL="stylesheet">
<body onLoad="document.forms[0].submit()">

<form
action="http://internal-server//login.asp?fds=File&doc=102¤t=1&seq=1"
method="post" name="form1">
<input type="hidden" name="username" style="width: 150px" value="test_user">
<input type="hidden" name="password" style="width: 150px" VALUE="test_pass">

<input type="submit" value="Login" style="width: 80px">

</form>
</body>
</html>

When the page loads it automatically logges me onto the system and then
redirects me to a file (pdf, xsl, doc etc). My problem is that I have to
download this file through my code and store it on the web server without a
user interface. Is there someone who can tell me how I can accomplish this?

Thanks,
Shawn

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: vishal | last post by:
hello friends i have one php script which generates html page containing form. what i want is submit this form using php script. pls give me some idea that how can i submit form using php...
3
by: Mark Michel | last post by:
Hi. I have made an html form which I would like to send by e-mail. When the recipient receives the e-mail form, I would like them to be able to fill it out and click the Submit button which will...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
19
by: Bruce Duncan | last post by:
I know this isn't a php group but I was wondering if my problem is with my javascript in my php code. I'm debugging someone else's code and I can't figure out why this form won't submit. This...
16
by: NathyZif | last post by:
I know I know, why would I want to submit the form from server-side code, if the only way to get to the server-side code was BY submitting the form. But that's just it, when the code-behind...
7
alexjimenez
by: alexjimenez | last post by:
Hi, i am newbie in ASP I try to redirect this form after submit to another page....what should i do? Strings of form : <%@ Page Language="C#" Debug="False" %> <%@ Register...
0
by: GhOsTTeCh | last post by:
Hey everyone , i am trying to submit a form 4 times with diffrent inputs. i have 2 files main.php $p = 1 while ($p < 5 ){ file_get_contents("submit.php?p=" . $p); echo "Submited form " ....
1
by: metalforever | last post by:
How do you redirect a form after submit(form sends email) ? This is pretty urgent for me. I have included the code in a pastebin. http://pastebin.org/249014 process_form sends the email. ...
3
by: Pankaj Singh | last post by:
hi, I want to submit a form present on an webpage through javascript. But the problem is that there is no regular html submit button, istead there is an image submit button. Moreover, while I do...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.