Jump to content

Recommended Posts

i'm using this line of code:

 

<?php
$lang = "he";
$text = "whatever\n";
$handle = fopen("/home/www/website.host.com/folder/".$lang."translations.php", "w") or die('Cannot open file');
fwrite($handle, $text) or die('Cannot write to file');
fclose($handle) or die('Cannot close file');
?>

 

it does not error, so it doesn't say "cannot open file"

the file does not exist on my server, i am attempting to create it with "w"

which supposedly should create the file if it doesn't already exist

 

well it DOESN'T and it still doesn't error?

How do I make it create a file if it doesn't exist??

 

Thank you

Are you even referencing the correct folders?  Try uploading a test document, and try doing an fopen using the same folder reference that you have there...except just take out the variable and replace it with the language folder in which you placed your test file.

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.