/    Sign up×
Community /Pin to ProfileBookmark

get data after html POST

Hello everyone, ?

I’m trying to write a script that itself posts requests to a script on a server (using html method post), and read the result back in (to extract some data from it).
Is this possible?? And if so, how?

To be more detailed:
here [url]http://www.febiac.be/public/technicar.aspx?lang=NL[/url] you can make a selection and after clicking ‘zoeken’ the inputvalues are processed and the results are show.
Can this be done from a script? Without manually clicking the submit?

Thanks in advance!

Bobby

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@redhatlookMay 28.2007 — Hi Bobby,

first of all you need to learn something about HTTP Protocol and then something about PHP Sockets.
Copy linkTweet thisAlerts:
@SheldonMay 28.2007 — So, you want to output the post data that the customer has submitted?

[code=php]
<?php
//example
$name = $_POST['name'];
echo($name);
// Would output where is entered in the text field "name"
?>[/code]
Copy linkTweet thisAlerts:
@Bobby_SauthorMay 28.2007 — Hi Bobby,

first of all you need to learn something about HTTP Protocol and then something about PHP Sockets.[/QUOTE]

Can't you provide some ready-to-use code please? :rolleyes: A simple script. I can't find one on the web.

Cheers
Copy linkTweet thisAlerts:
@redhatlookMay 28.2007 — Bobby ?, just click on the PHP Sockets link there are many examples, moreover there is a section called examples ? but in fact better is, if you understand what exactly your script does, so that is the reason why i suggested you HTTP Protocol link too ? If you have a concrete question feel free to ask ?
Copy linkTweet thisAlerts:
@Bobby_SauthorJun 06.2007 — Hello,

Sorry, I don't get it working. I can grab the resulting page of a post submit request ?

Here is the cleaned html page to submit a request. Can you have a look and give me a hand?
[code=html]<HTML>
<HEAD>
</HEAD>
<body>
<form name="Form1" method="post" action="http://www.febiac.be/public/technicar.aspx?lang=NL" id="Form1">
<input type="hidden" name="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" value="" />
<script language="javascript" type="text/javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
theform = document.Form1;
}
else {
theform = document.forms["Form1"];
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
<table>
<tr>
<td colSpan="2"><span id="lb_technicar_title">Raadpleging van de technische
fiches</span></td>
</tr>
<tr>
<td class="tablecell1"><span id="lb_t_segment">Segment</span>:</td>
<td class="tablecell1"><select name="dl_segment" id="dl_segment" class="leftdrop">
<option selected="selected" value="0">Alles</option>
<option value="I">breaks-grote</option>


</select></td>
</tr>
<tr>
<td class="tablecell1"><span id="lb_t_marque">Merk</span>:</td>
<td class="tablecell1"><select name="dl_marque" id="dl_marque" class="leftdrop">
<option selected="selected" value="0">Alles</option>
<option value="ALFA ROMEO">ALFA ROMEO</option>
<option value="ALPINA">ALPINA</option>



</select></td>
</tr>
<tr>
<td class="tablecell1"><span id="lb_t_fuel">Brandstof</span>:</td>
<td class="tablecell1"><select name="dl_carburant" id="dl_carburant" class="leftdrop">
<option value="3">LPG</option>
<option value="2">Diesel</option>
<option selected="selected" value="0">Alles</option>
</select></td>
</tr>
<tr>
<td class="tablecell1"><span id="lb_t_modele">Model</span>:</td>
<td class="tablecell1"><input name="tx_modele" type="text" id="tx_modele" class="leftfield" /></td>
</tr>
<tr>
<td class="tablecell1"><span id="lb_t_cyl">Cilinderinhoud</span>:</td>
<td class="tablecell1"><span id="lb_from">van</span><BR> <select name="dl_cyl_start" id="dl_cyl_start" class="leftdrop">
<option selected="selected" value="0">Alles</option>
<option value="08">08</option>
<option value="10">10</option>

</select> <BR> <span id="lb_to">tot</span><BR> <select name="dl_cyl_end" id="dl_cyl_end" class="leftdrop">
<option selected="selected" value="0">Alles</option>
<option value="08">08</option>


</select></td>
</tr>
<tr>
<td class="tablecell1"><span id="lb_t_prix">Prijs</span>: </td>
<td class="tablecell1"> <span id="lb_from1">van</span><BR> <input name="tx_prix_start" type="text" id="tx_prix_start" class="leftfield" />
<BR> <span id="lb_to1">tot</span><BR> <input name="tx_prix_end" type="text" id="tx_prix_end" class="leftfield" />
<BR> </td>
</tr>
<tr>
<td class="tablecell1">&nbsp;</td>
<td class="tablecell1"><span id="lb_t_prix_1">Prijs</span> </td>
</tr>
<tr>
<td class="tablecell1">&nbsp;</td>
<td class="tablecell1">&nbsp;</td>
</tr>
<tr>
<td class="tablecell1">&nbsp;</td>
<td class="tablecell1"><input type="submit" name="bt_search" value="Zoeken" id="bt_search" class="button2" /></td>
</tr>
<tr>
<td class="tablecell1">&nbsp;</td>
<td class="tablecell1">&nbsp;</td>
</tr>
</table>

<tr>
<td> </td>
</tr>
</form>
</body>
</HTML>
[/code]
Copy linkTweet thisAlerts:
@Bobby_SauthorJun 06.2007 — PS.

<input type="hidden" name="__VIEWSTATE" value="" />

-> this seems to need a value, but it's very very long so I could not post it here. But if you want it you can get it -> http://www.febiac.be/public/technicar.aspx?lang=NL
×

Success!

Help @Bobby_S spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...