PDA

View Full Version : need help about PHP/AMS



nico210
11-28-2009, 11:48 PM
Hi ! I made a script for delete a textfile, and rewrite it :


<?php
// 1 : Delete the file
unlink("text.txt")

// 2 : Open the file
$monfichier = fopen("text.txt", "a+");

// 3 : Write into the file
fputs($monfichier, $texte);

// 3 : Close the file
fclose($monfichier);
?>

And I join the script with a AMS code :


x=Input.GetText("Input1");
HTTP.Submit("http://nicolasworld.com/script.php", { texte=x}, SUBMITWEB_POST);

But It doesn't work !!
Can u help me please.. (And I want a script for read a textfile wit PHP/HTTP.Submit)

Thank u in advance

Sakuya
11-29-2009, 01:13 AM
I would recommend learning PHP first.



<?php
// 0 : Get the text to write. Hurrrrrrr.
$texte = $_POST['texte'];

// 1 : Delete the file
unlink("text.txt");

// 2 : Open the file
$monfichier = fopen("text.txt", "a+");

// 3 : Write into the file
fputs($monfichier, $texte);

// 3 : Close the file
fclose($monfichier);
?>


x=Input.GetText("Input1");
HTTP.Submit("http://nicolasworld.com/script.php", {texte=x}, SUBMITWEB_POST);

nico210
11-29-2009, 02:42 AM
Please, have a respect to other person on the world please! !
Can you give me a php code/AMS for read the text please ?

Sakuya
11-29-2009, 03:12 AM
http://www.php.net/manual/en/function.file-get-contents.php

nico210
11-29-2009, 03:28 AM
I need a code for AMS for take the PHP Variable from the returning of the textfile.

Sakuya
11-29-2009, 05:34 AM
I need a code for AMS for take the PHP Variable from the returning of the textfile.

I don't get it.

jassing
11-29-2009, 08:22 AM
I don't get it.

he wants the php script to read a text file and put it out so that http. can get the text of the file.

I think a good use of time would be to study up on php a bit more.

Scriptonite
11-29-2009, 01:27 PM
If your just trying to read a text file thats online use this:


HTTP.Download("http://nicolasworld.com/text.txt", "AutoPlay\\Docs\\text.txt", MODE_BINARY, 20, 80, nil, nil, nil);


You don't need to use the submit action to get text unless it's text generated or gathered by the php file. Using a php file to read the text and then pass it to ams would just be redundant.

nico210
11-30-2009, 05:50 AM
BUt I don't know if the HTTP.Download is faster than the PHP code

reteset
11-30-2009, 07:13 AM
if you want to read a text file on a remote server

why not use HTTP.Submit() with SUBMITWEB_GET


result = HTTP.Submit("http://www.domain.com/test.txt", {}, SUBMITWEB_GET, 20, 80, nil, nil);
Dialog.Message("Notice", result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

nico210
12-14-2009, 03:41 AM
thanks dude !