FORUMS: list search recent posts

Keep getting an error message online 62.................

COW Forums : Web Design

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brian Smith
Keep getting an error message online 62.................
on May 26, 2012 at 7:01:35 am

Hi, I keep getting this error on my php page:

Warning: mkdir() [function.mkdir]: File exists in /home/expert35/public_html/usa/join_form.php on line 62

Here's the line of code on line 62 that get the error from:

mkdir("memberFiles/$id", 0755);

I have the permissions set up like that on my webhosting server space.

I had it working perfect one day and all the sudden I don't know what happened?


Return to posts index

Curtis Thompson
Re: Keep getting an error message online 62.................
on May 26, 2012 at 5:40:12 pm

hello...

well - have you verified that $id has a value by dumping that to the screen? perhaps it's trying to just make the dir sans the id value if that is blank. it shouldn't be, but it's worth checking.

also check the apache err log to see what php put in there wrt the error...

sitruc


Return to posts index

Brian Smith
Re: Keep getting an error message online 62.................
on May 26, 2012 at 9:52:47 pm

I'm not anywhere near your level of this PHP Mysql.

I'm not sure exactly what you meant by this sentence from your reply to my question "have you verified that $id has a value by dumping that to the screen? perhaps it's trying to just make the dir sans the id value if that is blank. it shouldn't be, but it's worth checking."

Also if you could really break this down for me because I don't understand what you'r talking about below either and how to get my appche err log, I'm running all this off a server which I pay to have hoting with PHP and MySql anyway I don't understand how to get to the err log ...HELP!!
also check the apache err log to see what php put in there wrote the error...


Return to posts index


Curtis Thompson
Re: Keep getting an error message online 62.................
on May 27, 2012 at 12:32:21 am

hello...

sure - your line 62 is this:

mkdir("memberFiles/$id", 0755);

above that, id is set on line 60:

$id = mysql_insert_id();

that function gets the auto increment column value for the data you just inserted. so in a perfect world, let's say your id value returned the value "12" - that would effectively (in the eyes of php) make line 62:

mkdir("memberFiles/12", 0755);

but if your db insert failed for whatever reason, id would not be set, meaning that line 62 effectively becomes:

mkdir("memberFiles/", 0755);

now since i assume you already have a directory named "memberFiles" there, the mkdir command would fail with the message you are seeing each time you are running the script.

so you could test this by just doing an echo line out there that would show on the screen what is being passed to that mkdir command - i.e.:

echo "DEBUG: memberFiles/$id";
mkdir("memberFiles/", 0755);

and then on the screen when you run this, you could see what is printed there and see if the $id value is indeed set. it could not be set for any number of reasons related to your db insert above that - if that fails for any reason, $id will not have a value.

as for the apache error log - here's a link discussing that:

http://www.cyberciti.biz/faq/apache-logs/

most of the time, php will log to the apache error log when it has problems, so you could probably find there what is being logged for the mkdir command as well...

make more sense?

sitruc


Return to posts index

Brian Smith
Re: Keep getting an error message online 62.................
on May 27, 2012 at 1:28:18 am

That was fantastic!!!!! YOU'RE AWESOME!!!!!!!!!!!

THANK YOU!!!!


Return to posts index

Curtis Thompson
Re: Keep getting an error message online 62.................
on May 27, 2012 at 1:31:57 am

so was that the error?


Return to posts index


Brian Smith
Re: Keep getting an error message online 62.................
on May 27, 2012 at 2:03:33 am

Here's the error message I get now from putting that those lines of code in:

DEBUG: memberFiles/6
Warning: mkdir() [function.mkdir]: File exists in /home/expert35/public_html/usa/join_form.php on line 63


I went in and erased the database id records which is my primary key before i did this because I didn't have anymore emails to try, I have 4 email addresses. I noticed it let 2 other email addresses of mine show up that wee already in there. let em go in and delete the email section which is a unique key. and I'll come back and let you know what happens.


Return to posts index

Curtis Thompson
Re: Keep getting an error message online 62.................
on May 27, 2012 at 2:31:10 am

And of course the dir "6" isn't already there, right?

You can always add an is_dir test around that midair as well:

http://php.net/manual/en/function.is-dir.php

Then if the dir is already there you won't get the warning. But in this case as it's using the id val, the dir shouldn't ever be there already.


Return to posts index

Brian Smith
Re: Keep getting an error message online 62.................
on May 27, 2012 at 4:13:19 am

There was a dir6 in there. I just deleted the whole table and re-did it and now I don't get any errors at all!!!!

Thank you for your help and the way you explained it made a lot of sense to me and you are a good teacher!!!

I need to figure out how to put a form on each person that registers and get's their own page to also have a form on their page every time they go to it so they can put in there referrals and all that would show up on their page. You can have hundreds of referrals or just a few. How would I go about doing that?


Return to posts index

Curtis Thompson
Re: Keep getting an error message online 62.................
on May 28, 2012 at 5:54:48 pm

hello...

[Brian Smith] "I need to figure out how to put a form on each person that registers and get's their own page to also have a form on their page every time they go to it so they can put in there referrals and all that would show up on their page. You can have hundreds of referrals or just a few. How would I go about doing that?"

well - that's a bit beyond a write-up here, i'm afraid, but this sort of thing:

http://www.google.com/search?q=php+member+area

is basically what you want to do - i see some good tutorials in there that would probably get you started down a good path?

if you have more specific questions, please let us know!

sitruc


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]