![]() |
Passing member name to a PHP script via link
I need to be able to send the username to a script called memberspic.php to be able to display the pictures posted by that member.
How can I make a link that will send the user name to that other script? Whats the username variable? $bbuserinfo[username] is that it? post it to the other file? or is there a better way? thanks |
if you require global.php also in your memberspic.php you can use $bbuserinfo[username] everywhere in the script ;)
|
but which members name will be transfered :( ?
I need the name of the member whose profile it is to be transfered to memberspic.php so that it can be used like this: $result = mysql_query("SELECT image_name FROM photo_album WHERE file_name='VARIABLE OF MEMBER NAME'",$db); if (!$result) { echo("Sorry no Pictures: " . mysql_error(). "</p>"); exit(); } //Display while ($row = mysql_fetch_array($result)){ extract($row); echo("<img src=http://www.darkforum.com/profile/images/$image_name>"); } } ?> |
$bbuserinfo[username] is always the name of the logged in user
if you want to use another username: link to memberspic.php?username=blablabla and then use $username in memberspic.php |
Cant it automatically get the memberusername from the members profile page?
Like if I am in user "vivicas" profile and then there is a link on the bottom saying.. look at my pictures.. cant it automatically make $result = mysql_query("SELECT image_name FROM photo_album WHERE file_name=$membername ",$db); into: $result = mysql_query("SELECT image_name FROM photo_album WHERE file_name='vivica' ",$db); by using some variable that is passed from VB to the script? |
as i said, you have to pass the variable with the link to the new script
no other possibilities |
Thanks :) it works.. :) :)
now my members have a Member Picture link |
All times are GMT. The time now is 07:41 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|