Hi,

<html>
<body>

<?php
$file=fopen("welcome.txt","r");
?>

</body>
</html>

I have the code. Where would i save welcome.txt file. Will I save it on desktop or server side same directory as what i am currently working on?

Thanks.

Save on server WAMP/LAMP and give it php extension!

welcome.txt should save in a directory where your above php code file reside.

$file=fopen("welcome.txt","r");
$theData = fread($file, filesize('welcome.txt'));

echo $theData;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.