2 Replies - 524 Views - Last Post: 22 December 2010 - 08:55 AM Rate Topic: -----

#1 Snakeruler  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 09-April 10

Directory can't be created because it doesn't exist?

Posted 22 December 2010 - 08:33 AM

I'm still coding, and when someone signs up, this code is run (aswell as some other stuff):

<?php
$defaultwallcode ="loads of random code i cut down on to save space";
mkdir('profiles/walls/'. $username .'/'. 0777); //Create wall
$location = 'profiles/walls/'. $username .'/index.php';
$ww = fopen($location, 'w');
fwrite($ww, $defaultwallcode);
fclose($ww);
?>



I get these errors:

Warning: mkdir() [function.mkdir]: No such file or directory in /home/chattr/public_html/sign.php on line 117

Warning: fopen(profiles/walls/tsets/index.php) [function.fopen]: failed to open stream: No such file or directory in /home/chattr/public_html/sign.php on line 119

Warning: fwrite(): supplied argument is not a valid stream resource in /home/chattr/public_html/sign.php on line 120

Warning: fclose(): supplied argument is not a valid stream resource in /home/chattr/public_html/sign.php on line 121




All the $ variables are filled in, and I can tell they are because they are used in other bits of code in that file, which work fine.

I just don't understand it :/

The directory 'profiles' and 'walls' exist.


If it helps at all, all these files are on the main directory.


Someone please help :/

Is This A Good Question/Topic? 0
  • +

Replies To: Directory can't be created because it doesn't exist?

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3492
  • View blog
  • Posts: 10,072
  • Joined: 08-June 10

Re: Directory can't be created because it doesn't exist?

Posted 22 December 2010 - 08:50 AM

maybe you mean mkdir('profiles/walls/'. $username, 0777); ?

This post has been edited by Dormilich: 22 December 2010 - 08:50 AM

Was This Post Helpful? 1
  • +
  • -

#3 Snakeruler  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 09-April 10

Re: Directory can't be created because it doesn't exist?

Posted 22 December 2010 - 08:55 AM

Oh yeah, I missed the comma xD Thanks man :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1