Jump to content

Duplicating php files


Ri1es

Recommended Posts

I have just tried this code:

copy('../members/profile/profile.php', '../members/profile/$usr/profile.php?user=$usr');

It gives me the error:

 

Warning: copy(../members/profile/$usr/profile.php?user=$usr) [function.copy]: failed to open stream: No such file or directory in /home/a7172366/public_html/login sign up/verify.php on line 54

 

What have I done wrong?

 

Thanks in advance.

Link to comment
Share on other sites

I am trying to make it so that when a user verifies their email a file will be copied into the directory 'profile' and will have '?user=username' at the end of the file name so that I can use the $_GET function to acquire who the profile belongs to in order to present the right data from the database

 

hope that helps

Link to comment
Share on other sites

Well, you're going about this all wrong. Trying to add the argument to the end of the filename will not work. To present the right data, you query the database for the primary key id of the user's record when they log in. Then you persist that data throughput the time they remain logged in using a session variable, or a cookie. When you need to retrieve data, you use the stored pk id to query the database for the user's record again, after making sure they are logged in and have the appropriate permissions.

Link to comment
Share on other sites

I see what you mean.

However when for example you go and view this users profile, you will not have the correct variables to present the profile correctly, therefore I wuld like it  so that when the file is duplicated, it has variables in the code that use the GET function to customise the page correctly

 

Thanks for your time

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.