Autor Beitrag
DorJo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 139



BeitragVerfasst: Mi 27.02.08 16:29 
Hy @ all,
ich hab zwar schon das Forum durchforstet aber leider keine Lösung auf mein Problem gefunden :(
Es handelt sich um folgendes: ich möchte nichts weiter machen als mit einem delphiprog mittels post etwas an meine seite im inet übergeben und anschließend ermitteln wie meine seite darauf reagiert.

Das ist mein Delphiprog:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var
  TempStream : TStringStream;
  answer: TStringStream;
  x: TStringList;
begin
x:=TStringList.Create;
x.add('var1=test'); //die zu übergebene Variable
answer.Create('');
Idhttp1.post('meineseite.php',X, answer);
Memo1.Lines.LoadFromStream(answer);
end;


und das meine seite:
ausblenden Quelltext
1:
2:
3:
<?php
echo $_POST[var1];
?>


Wenn ich das dann ausführe kommt, nachdem idhttp1.post folgende Fehlermeldung:
[highlight]
Exception der Klasse EAccessViolation aufgetreten. Meldung: 'Zugriffsverletzung bei Adresse 00403F7E im Modul 'Project1.exe'. Lesen von Adresse 000001EC'
[/highlight]

Könnte mir bitte jamend erklären was das zu bedeuten hat?!
Danke schonmal im vorraus

MfG

Jo
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 27.02.08 16:38 
du musst answer auch erst noch instanzieren!
ausblenden Delphi-Quelltext
1:
answer:=TStringStream.Create;					

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
DorJo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 139



BeitragVerfasst: Mi 27.02.08 16:44 
Danke Jakob!!! Jetz kommt zumindest schonmal keine Fehlermeldung mehr! Aber er empfängt keine Daten! :cry: woran könnte das denn liegen?! =O
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mi 27.02.08 16:51 
Wenn du etwas in einen Stream schreibst, und anschließend auslesen willst, musst du den Stream auch "zurückspulen".
ausblenden Delphi-Quelltext
1:
Stream.Position := 0;					
DorJo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 139



BeitragVerfasst: Mi 27.02.08 16:56 
Hmm... ar es funktioniert trotzdem ni. als ich ma mit dem debugger durchgegangen bin hab ich festgestellt das "answer" leer ist... Könnte das an meinem php script liegen? egtl nicht odr?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.02.08 18:46 
user profile iconDorJo hat folgendes geschrieben:
Könnte das an meinem php script liegen? egtl nicht odr?

Dann ruf doch zum testen einfach mal eine andere Webseite auf... zum Beispiel www.google.de ... die sollte erreichbar sein. ;-)