chris_rulez001 Posted July 17, 2007 Share Posted July 17, 2007 in php, i am hoping to making a forum hosting system, how would you make it so i had this: http://mysite/chosenforumname would i have to use $_FILES or what? Quote Link to comment Share on other sites More sharing options...
rlindauer Posted July 17, 2007 Share Posted July 17, 2007 What exactly are you asking? Would you need $_FILES to do what? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 17, 2007 Author Share Posted July 17, 2007 in php, i am hoping to making a forum hosting system, how would you make it so i had this: http://mysite/chosenforumname would i have to use $_FILES or what? this is a general equiry, i am asking how would i make it so when the person signs up and gives them their info, it creates a directory with their chosen forum name? do i need to use $_FILES to do this? Quote Link to comment Share on other sites More sharing options...
rlindauer Posted July 17, 2007 Share Posted July 17, 2007 Try mkdir() $_FILES is an associative array of items uploaded via the post method. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 17, 2007 Share Posted July 17, 2007 no <?php $usename = $_POST['username']; // Name they choose. mkdir('/location/to/dir/'.$username); ?> but... what they are really doing are queries, they actually are not makeing any directories at all, they are also using htaccess files to do this. Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 17, 2007 Author Share Posted July 17, 2007 ok thanks Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Author Share Posted July 18, 2007 one more question using mkdir() how do i make it so that there forum is already there? what i mean is how do i get it so that their forum is there, when they go on the link? i would like it so it did the above Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 18, 2007 Share Posted July 18, 2007 you also want to put all the files in that folder? if so... have a look at copy() Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Author Share Posted July 18, 2007 not really what i am trying to do is get it so if a person goes to their own forum link which would be in the format of: http://mysite/their forum name but i dont want to put all the files into a folder, i want it to be in the root folder example of how i dont want the link to be: http://mysite/foldername/their forum name does this make sence? how would i make it so it worked from the root folder? using copy()? or some other method? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 18, 2007 Share Posted July 18, 2007 you actually might not even want to do the mkdir completely. What you will want to do is use an htaccess file. it MUST have a file name of this: .htaccess - place it in the root directory Then... in the file you would put this: RewriteEngine On RewriteRule ^http://mysite.com/(.*)$ index.php?username=$1 [nc] you now don't have to make a directory, it will make a fake directory for you, then... all you have to do is type this in: http://mysite.com/theirForum When in reality it is actually doing this: http://mysite.com/index.php?username=theirForum then in your php code, you would write it the same as you would write normal php, so... to echo the persons forum name all you need to do is this: <?php echo $_GET['username']; ?> does that all make sense? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Author Share Posted July 18, 2007 yes it does make sence, and thank you for your help Quote Link to comment Share on other sites More sharing options...
clanstyles Posted July 18, 2007 Share Posted July 18, 2007 that will be a lot safer. And as for copying things over. Have it read each file like a tree diagram. And copy ALSO don't forget to edit the config file to what ever db the user has. Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Author Share Posted July 18, 2007 ok thanks, urm ... ive run into a problem, ive made a test forum and when i type my forum address in it doesnt work, is it somthing to do with the .htaccess file? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Author Share Posted July 18, 2007 help? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Author Share Posted July 18, 2007 i need help someone please, i want to know what is going on please? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 19, 2007 Author Share Posted July 19, 2007 someone? can someone help me? Quote Link to comment Share on other sites More sharing options...
fert Posted July 19, 2007 Share Posted July 19, 2007 define "not working" Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 20, 2007 Author Share Posted July 20, 2007 its not working, its redirecting to my hosts page, help? its not actually going to the forum, when i type: http://mysite.com/testforum but when i go to: http://mysite.com/index.php?username=testforum it works. how do i get it so if you type: http://mysite.com/testforum it actually goes to it? i know i have to use .htaccess but i dont know exactly how to it via .htaccess? can someone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 21, 2007 Author Share Posted July 21, 2007 can someone help me? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 22, 2007 Author Share Posted July 22, 2007 im making a forum hosting service, i have a problem: when i type the below its not actually going to the forum: http://mysite.com/testforum but when i type the below, it goes to the forum: http://mysite.com/index.php?username=testforum how do i get it so if you type: http://mysite.com/testforum it actually goes to your forum? in my .htaccess file it says: RewriteEngine On RewriteRule ^/(.*)$ ^index.php?username=$1 can someone help me please? Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 24, 2007 Author Share Posted July 24, 2007 you actually might not even want to do the mkdir completely. What you will want to do is use an htaccess file. it MUST have a file name of this: .htaccess - place it in the root directory Then... in the file you would put this: RewriteEngine On RewriteRule ^http://mysite.com/(.*)$ index.php?username=$1 [nc] you now don't have to make a directory, it will make a fake directory for you, then... all you have to do is type this in: http://mysite.com/theirForum When in reality it is actually doing this: http://mysite.com/index.php?username=theirForum then in your php code, you would write it the same as you would write normal php, so... to echo the persons forum name all you need to do is this: <?php echo $_GET['username']; ?> ive tried this and it not working, can someone help me please? Quote Link to comment Share on other sites More sharing options...
rlindauer Posted July 24, 2007 Share Posted July 24, 2007 Post your htaccess file and php code please. Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 24, 2007 Author Share Posted July 24, 2007 ok .htaccess code: RewriteEngine On RewriteRule ^http://thunderboards.awardspace.co.uk/(.*)$ ^index.php?username=$1 [nc] my php code: <html> <head> <title>Message Board - Home</title> </head> <body> <?php $username = $_GET['username']; if ($username == true) { echo "This is a forum"; } else { echo ""; } ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
rlindauer Posted July 24, 2007 Share Posted July 24, 2007 Does your host even allow mod rewrite? Test it using this: RewriteEngine On RewriteRule test.html index.php Then go to http://thunderboards.awardspace.co.uk/test.html. If you see your index page, it works. Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 24, 2007 Author Share Posted July 24, 2007 Does your host even allow mod rewrite? Test it using this: RewriteEngine On RewriteRule test.html index.php Then go to http://thunderboards.awardspace.co.uk/test.html. If you see your index page, it works. i dont know if the host allows mod rewrite, and yes i have tried the thing you said and it doesnt work, help? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.