I'm not sure if this forum is the right one but if not just move it (mods) please.
I'm trying to make a interactive/register page to my site.
The form allows people to create there own page on the site, the username acts as the url ($name.php) but I'm trying to get it so that if the file already exists a message will appear saying that the name can no longer be used (or in this case, file because there creating files.) I'm have like no luck finding a code I've googled it about a million times (something like that) but is anyone here an expert that can help me?
I tried this one:
Code:
<?php
$filename = '/site/wi-fi/users/$name.php';
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
?>
Its not really working though... Can anyone help?