<?php
$oldumask = umask(0);
mkdir($url, 0777);
umask($oldumask);

$myFile = $url."/index.php";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData ="lots of things";
?>

Why am I not being allowed to write files to my website, it was recently working, my host had some technical issues yesterday,, and now it isn;t working.... are they directly related or is this just coincidence?

If just a coincidence.. can anyone offer any solutions please?!

I don't know if this may help but could be the file or folder your trying to write has only read permission try changing it inside your file mrg in c-panel or which ever hostpanel your using.

I don't know if this may help but could be the file or folder your trying to write has only read permission try changing it inside your file mrg in c-panel or which ever hostpanel your using.

Cheers for the response it was actually a coding error prior to this bit of code... i have corrected teh error

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.