vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Passing member name to a PHP script via link (https://vborg.vbsupport.ru/showthread.php?t=41094)

thenetbox 07-15-2002 12:43 PM

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

Xenon 07-15-2002 02:45 PM

if you require global.php also in your memberspic.php you can use $bbuserinfo[username] everywhere in the script ;)

thenetbox 07-15-2002 08:24 PM

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>");
}
}
?>

Xenon 07-15-2002 10:36 PM

$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

thenetbox 07-15-2002 11:52 PM

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?

Xenon 07-16-2002 10:34 AM

as i said, you have to pass the variable with the link to the new script

no other possibilities

thenetbox 07-17-2002 03:29 PM

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
  • Page Generation 0.01118 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete