Autor Beitrag
rossinie
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 19



BeitragVerfasst: Do 05.05.05 01:40 
Hallo,
ich nehm mir mit idHttp1 den qulltext von einer page und will gerne das formular auf dem rechner (von einem programm) ausfuellen lassen und via programm verschicken lassen.
Wie mach ich das denn? Sowas steht auf der Seite:

ausblenden Quelltext
1:
2:
3:
4:
<form action="http://url/meinscript.pcgi?id=12" method="POST" target="_top">
<input type="hidden" name="ses" value="SuperKekse">
<input type="Submit" name="proceed" value=" hier klicken ">
</form>
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 05.05.05 09:18 
also wenn du weisst, wie das formular aufgebaut ist und das auch immer gleich bleibt, kannst du die werte selber über INDY mit einem POST absenden.
wenn du allerings auf dynamische Formulare reagieren willst, dann bleibt dir nix anderes übrig, als einen HTML Parser zu basteln oder zu schauen, wo du einen herbekommst !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Do 05.05.05 09:19 
Und zwar so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
liste: tstringlist;
begin

liste:=tstringlist.create;
liste.add('ses="SuperKekse"');
liste.add('proceed=true');

idhttp1.post('http://url/meinscript.pcgi?id=12',liste);

liste.free;
end;

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 05.05.05 09:22 
@HansiOMG: ja so geht das. es würde aber voraussetzten, dass es immer dieselbe seite ist dir er aufruft. das hat er aber in seinem Posting nicht explizit gesagt.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Do 05.05.05 09:25 
Stimmt, aber wenn es ein dynamisches Feld ist, geb ich hier noch den Tipp, die Jedi Komponenten haben einen Super HTML-Parser dabei, der auf die Funktion hat Formulare auszufüllen, da kann ich mich allerdings nicht mehr dran erinnern, wie das geht.
Die Jedis findet man unter: www.dsdt.info/jedi/

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
rossinie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 19



BeitragVerfasst: Do 05.05.05 11:40 
es ist statisch, bis auf eine variable, die pars ich schon raus.
aber bei dem source
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
liste: tstringlist;
begin

liste:=tstringlist.create;
liste.add('ses="SuperKekse"');
liste.add('proceed=true');
idhttp1.post('http://url/meinscript.pcgi?id=12',liste);
/// hier die Fehlermeldung
liste.free;

end;


Da bekomm die Fehlermedung..

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Einloggen, um Attachments anzusehen!
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Do 05.05.05 12:09 
Die Fehlermeldung sagt doch alles:

302 Moved Temporarily bedeutet, das Skript ist momentan nicht verfügbar

Auszug aus dem RFC-1945 (HTTP 1.0)

Zitat:

302 Moved Temporarily

The requested resource resides temporarily under a different URL.
Since the redirection may be altered on occasion, the client should
continue to use the Request-URI for future requests.

The URL must be given by the Location field in the response. Unless
it was a HEAD request, the Entity-Body of the response should
contain a short note with a hyperlink to the new URI(s).

If the 302 status code is received in response to a request using
the POST method, the user agent must not automatically redirect the
request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued.

Note: When automatically redirecting a POST request after
receiving a 302 status code, some existing user agents will
erroneously change it into a GET request.

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
rossinie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 19



BeitragVerfasst: Do 05.05.05 12:13 
bin ja nicht so ganz doof *G*
das script IST aber verfügbar!
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Do 05.05.05 12:20 
Welche Version der Indys hast du überhaupt drauf?

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
rossinie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 19



BeitragVerfasst: Do 05.05.05 13:51 
das normale, das bei d7 ent. drauf ist
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 06.05.05 13:53 
Setzte mal die Eigenscahft HandleRedirects auf true

_________________
In the beginning was the word.
And the word was content-type: text/plain.
rossinie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 19



BeitragVerfasst: Fr 06.05.05 17:50 
ja geht!
danGGe
whitef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: So 26.10.08 03:41 
thread ist zwar schon älter, ab dennoch habe ich hierzu eine frage...

Problem bei mir ist das ich nur eine URL habe (www.pennergame.de/login/) und diese informationen aus dem quelltext rund um die einlogfelder:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
<form method="post" action="/login/check/">
<table><tr><td align="right">Spieler:</td><td>

<input maxlength="30" size="15" type="text" name="username" />
</td><td></td></tr><tr><td align="right">Passwort:</td><td>

<input maxlength="30" size="15" type="password" name="password" id="password" />
</td><td></td></tr><tr><tr><td colspan="2">

<input class="formbutton" type="submit" name="submitForm" value="Login" />  
</td></tr></table></form>


hab schon dutzende variationen selber probiert... aber es klappt einfach nicht...
wie zb:
ausblenden Quelltext
1:
2:
3:
http://www.pennergame.de/?nickname=XXX&password=XXX
http://www.pennergame.de/login/?nickname=XXX&password=XXX
http://www.pennergame.de/login/check/?nickname=XXX&password=XXX

kann mich da einfach nicht anmelden

PS: benutze hierbei die folgende komponenten: idhttp & TEmbeddedWB
LexXis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 170
Erhaltene Danke: 3



BeitragVerfasst: Mo 27.10.08 00:24 
Lass mal das "http://" in der URL weg, ist ja kein Teil der Adresse, sondern sagt ja nur etwas über das verwendete Protokoll aus.
BTW: Was halten denn die Betreiber des Browsergames (das ist doch eins?) davon, dass du da automatisiert agieren willst? Die meisten sehen sowas recht ungern :twisted:
whitef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: Mo 27.10.08 07:55 
joa das ist eins. keine ahnung was die denken. aber ich brauch das lediglich nur um gewisse stats auf dem lcd bildschirm meiner g15 anzuzeigen. ich werde mal die leute fragen ;)