OT: From Asp to Php

OT: From Asp to Php

Postby MarcoBoschi » Tue Mar 16, 2010 4: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: OT: From Asp to Php

Postby lailton.webmaster » Tue Mar 16, 2010 11:16 pm

<?php

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

?>
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: OT: From Asp to Php

Postby MarcoBoschi » Wed Mar 17, 2010 3:30 pm

Thank You very much!
Now I test it and .....thanks again
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: OT: From Asp to Php

Postby MarcoBoschi » Wed Mar 17, 2010 4:45 pm

This code works fine
<?php

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

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

fclose($fp);
?>

Thanks again
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: OT: From Asp to Php

Postby lailton.webmaster » Wed Mar 17, 2010 5: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
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 110 guests