Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8844627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:32:06+00:00 2026-06-14T11:32:06+00:00

Ok, so my site has a link where you can search up users and

  • 0

Ok, so my site has a link where you can search up users and go to their profile. You type a username and on the next page, it tells you if the username exists or not, and gives you a link. I think I have coded everything correctly, but apparently not.

Here is what happens: (my website echoes two pages, one if you are logged in and one if you are not logged in). If you are logged in AND you type a real username, then it will correctly display the text I want it to and the link. However, if you type a fake username when logged in, it just says the default text, not the text I necessarily want for this page.

When you are not logged in, it only displays the default text, no matter what you type.

Can someone help me and look at this code?

Default text for displaytext:

$displaytext = "Error";

$srstrSQL = "SELECT * FROM Users_For_CoinAwards WHERE Username = '$usersearched'";

$rs3 = mysql_query($srstrSQL, $connection);

while($row3 = mysql_fetch_array($rs3)){

if ($row3['Username'] == $usersearched)

{

$displaytext = "The user " . $row3["Username"] . " has been found. Please click on the below link to visit their profile.";

$displaylink = "<a href='http://www.coinawards.net63.net/user/" . $row3['Username'] . ".php' id='displaylink'>" . $row3['Username'] . "</a>";

}

else

{

$displaytext = "Sorry, the user " . $row3["Username"] . " was not found. Please check your query and try again.";

}

}

$row3 = mysql_fetch_array($rs3); print_r($row3);

Ok, and here is the part where it displays the text:

‘ . $displaytext . ‘

I double checked to make sure that the code above is the same if you are logged in or not, however the results still differ.

EDIT:

you can see what his happening for yourself at http://www.coinawards.net63.net/

Just click on the yellow ‘User Search’ button and type in a wierd random assortment of characters.

It will take you to the new page with the code below.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:32:07+00:00Added an answer on June 14, 2026 at 11:32 am

    Ok, try this. And please try $row[] with double or single quotes, you are mixing the two.

    $srstrSQL = "SELECT * FROM Users_For_CoinAwards WHERE Username = '$usersearched' ";
    
    $rs3 = mysql_query($srstrSQL, $connection);
    
    while($row3 = mysql_fetch_array($rs3)){
    
     $displaytext = "Error";
    
    if (mysql_num_rows($rs3) == 1)
    
    {
    
    echo $displaytext ."The user " . $row3["Username"] . " has been found. Please click on the below link to visit their profile.";
    
    echo $displaylink ."<a href='http://www.coinawards.net63.net/user/" . $row3['Username'] . ".php' id='displaylink'>" . $row3['Username'] . "</a>";
    
    }
    
    else
    
    {
    
    echo $displaytext."Sorry, the user " . $row3["Username"] . " was not found. Please check your query and try again.";
    
    }
    
    }
    
    $row3 = mysql_fetch_array($rs3); print_r($row3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a site which has a register link on every page, to allow
My site has several listing pages and on each page, I'd like to enable
My PHP site has header,body,footer files that are included into the INDEX.PHP page. On
I am working on a site similar to Craigslist where users can make postings
I am using an ASP.Net MVC site that has a link to an ASP.Net
I have a WooCommerce site which has a custom post type named 'products'. Each
How can I go about seeing if a particular website has a specific link
My site has been copied via an iframe and I can't break out, I
My site has a concept like Skype that allow users to go "Online" and
We have a page of search results which the user can hit in several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.