Hi,
How would I duplicate a file named ‘profile.php’ to a specific directory, then renaming it.
Thanks,
Please ask any questions.
I think how I would do it like this
Copy the profile.php rename at same time
[php]copy(‘profile.php’, ‘/dir/newprofile.php’); [/php]
You want to check file permissions and if exists also maybe other checks
You again?
I will try now!
Thanks for all of your help!
I have just tried the code:
[php]
copy(’…/members/profile/profile.php’, ‘…/members/profile/$usr/profile.php?user=$usr’);
[/php]
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.
At a guess you want it in a dir with thier username does this exist if not you might need to make one first?
[php]
copy(’…/members/profile/profile.php’, ‘…/members/profile/$usr/profile.php?user=$usr’);
[/php]
[php]
if (file_exists(’…/members/profile/profile.php’)){
copy(’…/members/profile/profile.php’, ‘…/members/profile/’.$usr.’/profile.php’);
}else{ echo ‘file does not exist’;}
[/php]
Thanks I will try now!
Seriously, is there anything I can do for you?
That is good but it isn’t quite how I wanted it. I would like it so that when a profile is viewed, I can look at the URL and see who’s profile it is. For example:
www.blu-byte.co.cc/members/profile/Noodles/profile.php
Is there a way to retrieve the name in bold from the url in order to specify who the profile belongs to?
Many thanks!
You have to make that up with code
[php]$link = ‘www.xxx.co.cc/members/profile/’.$usr.’/profile.php’;[/php]
www.xxx.co.cc/members/profile/'.<php echo $usr;?>.'/profile.php
I’m not sure what you mean?
For example, when a user goes onto profile.php, that is in the directory ‘Noodles’ I would to be able to GET data from the URL so that I can go into my database and retrieve lots more specific data that is relevant to the user.
I hope you understand.
thats the question how does he go to profile.php
For example, when a user goes onto profile.php
well $usr is a variable so what ever $usr = noodles will be put in place of it.
where are you getting $usr var from ?
Hmmm. Basically I need a way to take a string from a URL, any help?
Show me the url coding
I do not see why you need it from the url if it makes a new profile with $usr then it knows what $usr is already you just have to pass it along.
I will give you the process in simple steps:
- create a directory inside the folder ‘profiles’ and name it the username. <- I can do this
- When another user goes and looks at the profile it goes to the URL and sees this www.xxx.com/profiles/Noodles/profile.php
3.It takes the Username bit (Noodles in this case) and stores it in a variable.
- echos that variable.
Also at the moment the profile.php that is copied just has variables in the places where the username, biography etc goes.
How does user goes and looks at the profile ?
Answer this question by telepathy ?
I guess you would make an array of the file names loop through the names then explode them take the chunk you want and add it to a var array which you then echo as a loop with a count .
The user looks at the profile by a hyperlink
how would I explode an array and retrieve the bit I want?
Many thanks!
use the function explode()
Thanks I will try now!
I am tired of this problem, could you help me on a live stream to sort this out quick?
Go to www.sync.in/phphelp
The point of help forums are so others do not have to ask the same questions they can look and find the answer.
If you want it done fast maybe get a professional to do it for you on a freeelance site.