PHP Errors.

They have: 330 posts

Joined: Apr 2000

I am new to PHP as some of you have already found out. I don't know any of the errors or the common fixes for them like I do with ASP. I am now getting an error that states..

Warning: Undefined variable: dircreate in D:\MainWeb\php\files\mkdir.php on line 18
'

I know what it's saying and I looked at the code and found the variable it's talking about. The variable is being used like this though...

// if form has been submitted
if($dircreate)
'

Is there a better way to check for that variable?

Does this mean the form shouldn't work?

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I have seen that error once myself... when I was configuring PHP for my cousins' NT box. I spent a while going through all the configs, and looking at my script (which worked on other servers), but couldn't find anything. Time was running out and I needed to leave soon, so as a last ditch effort, I coppied the php.ini file from my PC to his, and it fixed it.

So, it's some PHP settings on the server. But I still don't know exactly what it was.

What the error means, is that you've not given the variable a value yet, so you can't evaluate it. You could try:
if (isset($dircreate))

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 9 posts

Joined: Feb 2000

It's just a warning and not a fatal error.
If you use error reporting level of 15, it'll give that.

They have: 330 posts

Joined: Apr 2000

How would I change the reporting level?

They have: 9 posts

Joined: Feb 2000

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

what level do you recommend?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.