Hello
I'm making a custom page for my site using this:
https://vborg.vbsupport.ru/showthread.php?t=62164
In my .php page I have a function that gets the username and returns some result from a database.
When I link to the user page I used:
http://...../mypage.php?username=$bbuserinfo[username]
That link works perfect, the user gets his information with no problem.
But if the user reaches the page directly.
http://...../mypage.php
Then the user gets the first rows from the database.
In my .php page I have a function like this:
Quote:
$vbulletin->input->clean_array_gpc('r', array(
'username'=> TYPE_STR
));
$username = $vbulletin->GPC['username'];
$strSQL = "
SELECT * FROM table
WHERE user_name LIKE '%".$username."%'
";
$result = $vbulletin->db->query_read($strSQL);
if ($vbulletin->db->num_rows($result) == 0) {
$output .= 'No Record!';
} else {
while ($row = $vbulletin->db->fetch_array($result)) {
'
'if
'//query will read only three rows
'
'if
'
}
?>
|
How can I read the username and then run the query? I think the problem is the the page is displaying the information before it reads who is the user in the page.
Thanks you!