text auf server speichern [gelöst] und anzeigenlassen [Gelöst]und immer den zum aktuelsten runer scrollen und automatich aktualisiren[offen]

  • hallo

    ich habe ein kleines problem ich möchte das wenn man auf den knopf senden drückt

    eine txt datei auf meinen server geschikt wird mit dem inhalt aus den boxen


    Spoiler anzeigen
    [autoit]

    ;Include constants
    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ;Initialize variables
    Global $GUIWidth
    Global $GUIHeight

    [/autoit] [autoit][/autoit] [autoit]

    $GUIWidth = 150
    $GUIHeight = 500

    [/autoit] [autoit][/autoit] [autoit]

    ;Create window
    GUICreate("Kontakt me", $GUIWidth, $GUIHeight)

    [/autoit] [autoit][/autoit] [autoit]

    ; INPUTBOX
    GUICtrlCreateInput("", 10, 200, 130, 20)

    [/autoit] [autoit][/autoit] [autoit]

    ; INPUTBOX
    GUICtrlCreateInput("", 10, 300, 130, 20)

    [/autoit] [autoit][/autoit] [autoit]

    ;Create an "Senden" button
    $OK_Btn = GUICtrlCreateButton("Senden", 50, 425, 70, 25)

    [/autoit] [autoit][/autoit] [autoit]

    ;Show window/Make the window visible
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    ;Loop until:
    ;- user presses Esc
    ;- user presses Alt+F4
    ;- user clicks the close button
    While 1
    ;After every loop check if the user clicked something in the GUI window
    $msg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Select

    [/autoit] [autoit][/autoit] [autoit]

    ;Check if user clicked on the close button
    Case $msg = $GUI_EVENT_CLOSE
    ;Destroy the GUI including the controls
    GUIDelete()
    ;Exit the script
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    ;Check if user clicked on the "Senden" button
    Case $msg = $OK_Btn
    MsgBox(64, "Senden", "Hir sollte eig die messeg gesendet werden!")
    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit]


    und wenn man auf den knopf senden klickt sollen die beiden daten aus den input boxen

    auf meinem server in einer txt datei geschpeichert werden


    bedanke mich jetzt schonmal für jede art von hilfe


    //edit:

    Momentan siht der code so aus

    Spoiler anzeigen
    [autoit]


    ;Include constants
    #include <GUIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIEdit.au3>
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    #include <IE.au3> ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    #include <INet.au3> ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    ;Initialize variables
    Global $GUIWidth
    Global $GUIHeight
    $GUIWidth = 600
    $GUIHeight = 450
    ;Create window
    GUICreate("Kontakt me", $GUIWidth, $GUIHeight)
    ; INPUTBOX
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;MIT VARIABLE
    $Content = ReadText()
    $output1 = GUICtrlCreateInput($Content, 10, 10, 580, 280, $ES_Multiline + $ES_AutoVScroll + $WS_VScroll)
    $Refresh_Btn = GUICtrlCreateButton("Aktualisieren", 490, 300, 100, 25)
    GUICtrlCreateLabel("Name", 10, 310, 80, 20)
    $input1 = GUICtrlCreateInput("", 10, 330, 180, 20)
    ; INPUTBOX
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;MIT VARIABLE
    GUICtrlCreateLabel("Nachricht", 10, 360, 80, 20)
    $input2 = GUICtrlCreateInput("", 10, 380, 180, 20)
    ;Create an "Senden" button
    $OK_Btn = GUICtrlCreateButton("Senden", 120, 410, 70, 25)
    ;Show window/Make the window visible
    GUISetState(@SW_SHOW)
    GUICtrlSetState( $input1, $GUI_Focus )
    ;Loop until:
    ;- user presses Esc
    ;- user presses Alt+F4
    ;- user clicks the close button
    While 1
    ;After every loop check if the user clicked something in the GUI window
    $msg = GUIGetMsg()
    Select
    ;Check if user clicked on the close button
    Case $msg = $GUI_EVENT_CLOSE
    ;Destroy the GUI including the controls
    GUIDelete()
    ;Exit the script
    Exit
    Case $msg = $Refresh_Btn
    GUICtrlSetState($Refresh_Btn, $GUI_Disable)
    $Content = ReadText()
    GUICtrlSetData($output1, $Content)
    _GUICtrlEdit_SetSel($output1, StringLen($Content), StringLen($Content))
    GUICtrlSetState($Refresh_Btn, $GUI_Enable)
    GUICtrlSetState($input2, $GUI_Focus)
    ;Check if user clicked on the "Senden" button
    Case $msg = $OK_Btn
    ;MsgBox(64, "Senden", "Hir sollte eig die messeg gesendet werden!")
    GUICtrlSetState($OK_Btn, $GUI_Disable)
    $oIE = _IECreate("Levin1993.de/ZCQ.php?name=" & _INetExplorerCapable(GUICtrlRead($input1)) & "&data=" & _INetExplorerCapable(GUICtrlRead($input2)), 0, 0)
    _IELoadWaitTimeout(3000)
    _IELoadWait($oIE)
    _IEQuit($oIE)
    GUICtrlSetState($OK_Btn, $GUI_Enable)
    $Content = ReadText()
    GUICtrlSetData($output1, $Content)
    _GUICtrlEdit_SetSel($output1, StringLen($Content), StringLen($Content))
    GUICtrlSetState($input2, $GUI_Focus)
    ;HIER SENDEN:
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;InetGet("Levin1993.de/ZCQ.php?name="&_INetExplorerCapable(GUICtrlread($input1))&"&data="&_INetExplorerCapable(GUICtrlread($input2)), @tempdir&"\~temp36.txt")
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    EndSelect
    WEnd
    Func ReadText()
    InetGet( "http://www.levin1993.de/FILENAME.txt", @WorkingDir & "\Temp.txt", 1 )
    $File = FileOpen( @WorkingDir & "\Temp.txt", 0 )
    $Content = FileRead( $File )
    FileClose( $File )
    $Content = StringReplace( $Content, @LF, @CRLF )
    return $Content
    EndFunc

    [/autoit]

    3 Mal editiert, zuletzt von Masterfreak0815 (22. Februar 2008 um 16:25)

  • Hat der Server PHP?
    Dann dort ein Script erstellen, das die Per GET übergebenen Parameter in die Datei schreibt.
    Dann senden:

    [autoit]

    InetGet("server.de/Script.php?name="&_INetExplorerCapable(GUICtrlread($input1))&"&message="&_INetExplorerCapable(GUICtrlread($input2)))

    [/autoit]
  • danke für die antwort aber leider verstehe ich das nicht gans kannst du das villeicht etwas genauer erklären?


    edit: achso hätte ich ja fast vergessen ja mein server unterstütst php

  • Dann erstell ein PHP-Skript, dass die Get-Variable in eine Textdatei schreibt...

    EDIT: Habs dir schnell gecodet...

    PHP
    <?php
    $file = fopen($_GET['name'].".txt", "a+");
    fwrite = ($data, $_GET['data'];
    fclose($file);
    ?>


    Die Datei speicherst du unter einem beliebigen Namen ab.
    Du kannst den Namen der textdatei übergeben per name="TextdateinameOhneTXT" und den inhalt per data="Blablabla"
    So könnte es komplett aussehen:

    Zitat

    hinzufuegen.php?name="TextdateiName"&data="Textdateiinhalt"

    Einmal editiert, zuletzt von born2die (17. Februar 2008 um 20:45)

  • Dann musst du an die PHP-Datei Parameter übergeben.
    Diese sind "name" und "data". (Ich nehm einfach mal den Autoit-Code von progandy und verändere diesen...)

    [autoit]

    InetGet("server.de/Script.php?name="&_INetExplorerCapable(GUICtrlread($input1))&"&data="&_INetExplorerCapable(GUICtrlread($input2)))

    [/autoit]


    Wobei in meinem Fall "name "der Name der Textdatei ist die erstellt/geöffnet werden soll. Und "data" ist der Text der in diese Textdatei geschrieben werden soll.
    Du kannst das Skript natürlich deinen Bedürfnissen anpassen und erweitern ;)

  • InetGet("Levin1993.de/ZCQ.php?text="&_INetExplorerCapable(GUICtrlread($input1))&"&data="&_INetExplorerCapable(GUICtrlread($input2)))

    ich habe das jetzt soveit angepasst aber ich komme nicht weiter mit data wie kann ich machen das mit data die beiden inputboxen gemeint sind

  • Upps, seh grad hab nen Fehler drin naja hier das du beides reinschreiben kannst:

    PHP
    <?php
    $file = fopen($_GET['text'].".txt", "a+");
    fwrite = ($file, $_GET['data1'];
    fwrite = ($file, $_GET['data2'];
    fclose($file);
    ?>


    jetzt schreibt er beides rein musst nur noch data2 dranhängen ;)

  • also erst mal danke für die hilfe das mit php habe ich ezz aber was mache ich ezz hiermit??

    [autoit]

    InetGet("Levin1993.de/ZCQ.php?text="&_INetExplorerCapable(GUICtrlread($input1))&"&data="&_INetExplorerCapable(GUICtrlread($input2)))

    [/autoit]
  • Da:

    Spoiler anzeigen
    [autoit]

    ;Include constants
    #include <GUIConstants.au3>
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    #include <IE.au3>
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\

    [/autoit] [autoit][/autoit] [autoit]

    ;Initialize variables
    Global $GUIWidth
    Global $GUIHeight

    [/autoit] [autoit][/autoit] [autoit]

    $GUIWidth = 150
    $GUIHeight = 500

    [/autoit] [autoit][/autoit] [autoit]

    ;Create window
    GUICreate("Kontakt me", $GUIWidth, $GUIHeight)

    [/autoit] [autoit][/autoit] [autoit]

    ; INPUTBOX
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;MIT VARIABLE
    $input1 = GUICtrlCreateInput("", 10, 200, 130, 20)

    [/autoit] [autoit][/autoit] [autoit]

    ; INPUTBOX
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;MIT VARIABLE
    $input2 = GUICtrlCreateInput("", 10, 300, 130, 20)

    [/autoit] [autoit][/autoit] [autoit]

    ;Create an "Senden" button
    $OK_Btn = GUICtrlCreateButton("Senden", 50, 425, 70, 25)

    [/autoit] [autoit][/autoit] [autoit]

    ;Show window/Make the window visible
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    ;Loop until:
    ;- user presses Esc
    ;- user presses Alt+F4
    ;- user clicks the close button
    While 1
    ;After every loop check if the user clicked something in the GUI window
    $msg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Select

    [/autoit] [autoit][/autoit] [autoit]

    ;Check if user clicked on the close button
    Case $msg = $GUI_EVENT_CLOSE
    ;Destroy the GUI including the controls
    GUIDelete()
    ;Exit the script
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    ;Check if user clicked on the "Senden" button
    Case $msg = $OK_Btn
    MsgBox(64, "Senden", "Hir sollte eig die messeg gesendet werden!")
    ;HIER SENDEN:
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    InetGet("Levin1993.de/ZCQ.php?text="&_INetExplorerCapable(GUICtrlread($input1))&"&data="&_INetExplorerCapable(GUICtrlread($input2)))
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    EndSelect

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit]
  • verwendest du schon v 3.2.10.0 ?

    //Edit: das include ist:

    [autoit]

    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    #include <INet.au3>
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\

    [/autoit]
  • ja ich benutze schon v 3.2.10.0

    es kommt zwar keine fehlermeldung mehr aber es wird keine datei erstellt

  • Moin Masterfreak0815,

    bei dem InetGet fehlt der zweite Parameter mit dem Dateinamen.
    Also ändere mal die Zeile
    InetGet("Levin1993.de/ZCQ.php?text="&_INetExplorerCapable(GUICtrlread($input1))&_
    "&data="&_INetExplorerCapable(GUICtrlread($input2)))
    so das du vor der letzten Klammer ',[Dateiname]' reinschreibst.
    Dann wird (hoffentlich ;)) auch eine Datei erstellt.

  • Spoiler anzeigen


    [autoit]


    ;Include constants
    #include <GUIConstants.au3>
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    #include <IE.au3>
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    #include <INet.au3>
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    ;Initialize variables
    Global $GUIWidth
    Global $GUIHeight
    $GUIWidth = 150
    $GUIHeight = 500
    ;Create window
    GUICreate("Kontakt me", $GUIWidth, $GUIHeight)
    ; INPUTBOX
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;MIT VARIABLE
    $input1 = GUICtrlCreateInput("", 10, 200, 130, 20)
    ; INPUTBOX
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    ;MIT VARIABLE
    $input2 = GUICtrlCreateInput("", 10, 300, 130, 20)
    ;Create an "Senden" button
    $OK_Btn = GUICtrlCreateButton("Senden", 50, 425, 70, 25)
    ;Show window/Make the window visible
    GUISetState(@SW_SHOW)
    ;Loop until:
    ;- user presses Esc
    ;- user presses Alt+F4
    ;- user clicks the close button
    While 1
    ;After every loop check if the user clicked something in the GUI window
    $msg = GUIGetMsg()
    Select
    ;Check if user clicked on the close button
    Case $msg = $GUI_EVENT_CLOSE
    ;Destroy the GUI including the controls
    GUIDelete()
    ;Exit the script
    Exit
    ;Check if user clicked on the "Senden" button
    Case $msg = $OK_Btn
    MsgBox(64, "Senden", "Hir sollte eig die messeg gesendet werden!")
    ;HIER SENDEN:
    ;\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/**\/
    InetGet("Levin1993.de/ZCQ.php?text="&_INetExplorerCapable(GUICtrlread($input1))&"&data="&_INetExplorerCapable(GUICtrlread($input2))"test")
    ;/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\
    EndSelect
    WEnd

    [/autoit]

    ich habe das jetzt so da eingefügt da kommt aber immer ne fehler meldung line 58 error missing separator charakter after keyword