Jump to content

adding a .php page on sign up


almightyegg

Recommended Posts

<?php
$file = fopen("$username/index.php","w");$write = fwrite($file,'
<?php 
//your php page contents
?>');fclose($file);
?>

one thing to notice, becareful when you are locating your index.php file, since you have just created your username folder, therefore, you have to use the same variable to locate it, noticed i used "$username".

Ted

Link to comment
Share on other sites

where would i find my httpd.conf file  :-X I can't find it in my files. There is .htaccess and .errorlog but no httpd.conf

 

Assuming a Linux machine, it's usually under /etc/httpd/httpd.conf, however this differs based on the environment. As well, your web host may not allow you to edit it. I have no idea where the file resides on Windows, but I think it's in the apache directory.

Link to comment
Share on other sites

Did you try using mod_rewrite? It might already be enabled...move on to the next step in the article, or call your host.

 

i thought everything was done in the httpd.conf file???

 

Wasn't there an article on the main site recently about clean urls without mod rewrite? That involves custom error pages though, so if your host doesn't allow them (though most do), that won't work either.

 

I have custom error pages yes, do you know where this article is?

Link to comment
Share on other sites

Did you try using mod_rewrite? It might already be enabled...move on to the next step in the article, or call your host.

 

i thought everything was done in the httpd.conf file???

 

No, it's done in the htaccess file.

Link to comment
Share on other sites

nope...I just did that and some of it is understandable  but some is all squiggles and ascii symbols

 

That's part of how .htaccess works. For example:

 

RewriteEngine On
RewriteRule ^users/([^/]*)$.php /users.php?user=$1

 

from the first page would rewrite anything from the /their_username/ folder with a .php extension to users.php?user=their_username. At least I believe that's how I understood the post.

Link to comment
Share on other sites

oh this is so god damn confusing!!

would I not have to label the folder with the username varible too??

 

Are you sure there's no simple way to redirect www.mysite.com/username to www.mysite.com/userpage.php?id=$userid

 

that's why I originally was going to create a file on sign up in their directory called index.php whihc would redirect but most people said I'd need mod_rewrite for that too  :(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.