The Arcive of vBulletin Modifications Site. |
|
Passing member name to a PHP script via link Details »»
|
|||||||||||||||||||||||||||
|
Passing member name to a PHP script via link
Developer Last Online: Jan 2013
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 Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
if you require global.php also in your memberspic.php you can use $bbuserinfo[username] everywhere in the script
|
|
#3
|
|||
|
|||
|
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>"); } } ?> |
|
#4
|
||||
|
||||
|
$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 |
|
#5
|
|||
|
|||
|
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? |
|
#6
|
||||
|
||||
|
as i said, you have to pass the variable with the link to the new script
no other possibilities |
|
#7
|
|||
|
|||
|
Thanks
it works.. now my members have a Member Picture link |
![]() |
|
|