View Full Version : Good practice or not?
I have a form that, when filled out, it goes to another page that creates a directory from the form info. On this page there is a link to another page where you can edit the info. If I use the link in this page to go back to the other page, everything is fine. If I use the browsers back button, I get the error messages tellink me that this directory already exists. Is it ok practice to just supress the error message with the @ symbol or should I do something else. I don't see anything wrong with this. Just looking for some input.
CyanBlue
01-26-2005, 02:37 AM
It's not a good practice only if you don't know why that's happening... :D
It's not a good practice because you are ignoring the error message if you do that... I don't know why that's happening, but see if you can supress that routine first... I have no idea how to do that though... :D
Well, I know exactly why it's happening. It's because it's trying to create directories that were already created with the first pass through this page. I guess I could just add an if statement saying "if this directory exists, do something else instead. If it doesn't create it." :)
I haven't done this yet. Wanna save me some searching time by pointing me in the right direction? :D
CyanBlue
01-26-2005, 03:06 AM
Uh... No need to search... The first thing I check is the PHP manual... and found this is_dir() function... ;)
<?php
if (is_dir('testDirectory'))
{
echo("Directory exist.");
}
else
{
echo("Directory does not exist.");
}
?>
Thanks CyanBlue! That was going to be my first look as well. I'm just finishing up a functional spec for this site so I can present it to the customer tomorrow. Just doing this has taken a few hours. :p Now that I'm going through it page by page and explaining the functionality, I think I did a pretty thorough job on this thing. :) It's definitely the most complex thing I've done so far.
CyanBlue
01-26-2005, 03:33 AM
A functional spec??? You just sound like a product manager... :p
That sounds good... I am sure your client will like it alot... ;)
That sounds good... I am sure your client will like it alot...
Let's hope so! :D
I've actually been rethinking a few things about adding projects. Since the same client can have multiple jobsites, I'm think I may want to create an addresses table so when they choose an existing client from the list, it will take them to the next page where they can choose an address or add a new one......hmmm.
So you don't like Dreamweaver, huh? Now that I've been using it for a while, I like it a lot for designing. But for programming, which you do mostly, I see your point. ;)
CyanBlue
01-26-2005, 07:55 PM
Yeah... I guess that's another way of handling it... :)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.