FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OT: From Asp to Php
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
OT: From Asp to Php
Posted: Tue Mar 16, 2010 04:50 PM

Dear friend
I have to rewrite this little script asp in Php.

<%
Set fs = Server.CreateObject( "Scripting.FileSystemObject" )

Set fl = fs.OpenTextFile( Server.MapPath( "cdr.txt" ), 8 )

fl.writeline request.querystring

fl.close

Set fl = Nothing

Set fs = Nothing

%>

Thanks in advance
Marco

Marco Boschi
info@marcoboschi.it
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: OT: From Asp to Php
Posted: Tue Mar 16, 2010 11:16 PM

<?php

$arquivo  = fopen(&quot;cdr.txt&quot;,&quot;r+&quot;);
$cText    = &quot;save it.&quot;; // i dont meet command request.querystring, more think that is $_POST['filed'];
fwrite($arquivo,$cText);
fclose($arquivo);

?>

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: OT: From Asp to Php
Posted: Wed Mar 17, 2010 03:30 PM

Thank You very much!
Now I test it and .....thanks again

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: OT: From Asp to Php
Posted: Wed Mar 17, 2010 04:45 PM

This code works fine
<?php

$fp = fopen("cdr.txt", "a");

fwrite( $fp, $_SERVER['QUERY_STRING']);

fclose($fp);
?>

Thanks again

Marco Boschi
info@marcoboschi.it
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: OT: From Asp to Php
Posted: Wed Mar 17, 2010 05:07 PM

Good !

if you will use this Server Online, you need set chmod 0775 or 0777 in your file to can write in file.

more info:

http://www.php.net/fwrite

Continue the discussion