Ri1es Posted August 6, 2012 Share Posted August 6, 2012 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. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted August 6, 2012 Share Posted August 6, 2012 Why are you trying to do that in the first place? Quote Link to comment Share on other sites More sharing options...
Ri1es Posted August 6, 2012 Author Share Posted August 6, 2012 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 Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted August 6, 2012 Share Posted August 6, 2012 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. Quote Link to comment Share on other sites More sharing options...
Ri1es Posted August 6, 2012 Author Share Posted August 6, 2012 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 Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 Still doing it wrong. Start with some basic PHP tutorials. Quote Link to comment Share on other sites More sharing options...
Ri1es Posted August 6, 2012 Author Share Posted August 6, 2012 Well if you guys can't help me, I have no hope really. It is all in my head, you just can't see it properly. Thanks anyway Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 6, 2012 Share Posted August 6, 2012 No, you're REALLY just trying to do something the wrong way. Stop thinking about it that way, and start over. Quote Link to comment Share on other sites More sharing options...
Ri1es Posted August 6, 2012 Author Share Posted August 6, 2012 Sorry but I have coded many pages revolved around that idea, so that isn't really an option for me :-\ Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted August 6, 2012 Share Posted August 6, 2012 Suit yourself. Good luck with it. Quote Link to comment Share on other sites More sharing options...
Ri1es Posted August 6, 2012 Author Share Posted August 6, 2012 Thanks :wtf: 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.