Jump to content

Beginner Help please


prg1

Recommended Posts

Hi all messing about with php , trying to get my head round the basics :

 

ok I have a file called test.php

 

with this in it

 

<?

$ourFileName = "testFile.txt";

$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");

fclose($ourFileHandle);

?>

 

when I run this instead of creating a blank text file called testfile.txt

 

all it does is repeat the code in the command box window as below

 

C:\php>php -f c:\php\test\test.php

<?

$ourFileName = "testFile.txt";

$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");

fclose($ourFileHandle);

?>

C:\php>

 

Anyone got a clue as to why it wouldnt create a text file please?

 

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.