![]() |
getting username, title, ranks from user id (need php code)
hey im making a page.
I'll provide it a user id & i want it to show that - user name (with proper HTML markup) - user title (custom title if that user use one) - ranks i mean i'll type the link like this: http://DOMAIN/PATH/MYFILE.php?u=6 (here 6 is the user id) it'll show me those info of user-6 plz give me the php code for such a file... thank you. :) |
Look up the function fetch_userinfo (do a search in your files for it, I can't remember which file it is in).
|
i looked in function.php file & found some code...based on those i wrote these code
PHP Code:
but what about Ranks plz help me about RANKS |
You might want to familiarize yourself with the vBulletin API. In the functions, you will find fetch_rank.
|
Isn't his SQL query open to injection attacks?
Unless vB's query_read() function protects against it. |
Like I told him, he should use the existing functions. And yes, he should use the input cleaner also.
|
guys english plz :( im not an advance vb coder.
1st of all what is "SQL query open to injection attacks". how can i solve it? lynne u told about existing functions ! could u guys plz, plz & plz post some PHP code here as an example? plz stop telling look here or there...find it....its really not an easy thing for a novice coder |
The existing php code is in the vbulletin files. Did you try a search in the files for fetch_userinfo? It shows up many times and you can see the use of it. These are some excepts from a page I use:
First the cleaner is used on the userid that is passed from the form: PHP Code:
PHP Code:
There are articles you can read on the user of the vbulletin cleaner and on writing secure code. |
thank you Lynne. thank you very much.
especially for PHP Code:
i tried something like this PHP Code:
can u plz help me....plz |
Did you look the function up in the API like I suggested? The API will tell you what file it is in. Or, do a search in the files for the function to find what file it is in and then make sure you either include the file in your code, or copy/paste the function into your code.
|
All times are GMT. The time now is 11:21 PM. |
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:
|