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 6665245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:42:10+00:00 2026-05-26T02:42:10+00:00

Im having a problem when trying to create a member login system where each

  • 0

Im having a problem when trying to create a member login system where each user is directed to their own editable profile. I’m at the login stage right now, and trying to pass the user’s id securely from the login page to their profile page so that I can display their profile information.

Right now, I am being redirected to ‘mydomain.com/index.php?test=Resource%20id%20#8’, (I want, for example ‘mydomain.com/index.php?test=1111’) after this chunk of code:

$user_id = mysql_query("SELECT `id` FROM `users` WHERE `username` = '$user' AND `active`='1'");  
header("location: profile.php?test='$user_id'");
exit();

where $user has been sanitized using trim, htmlspecialchars, and mysql_real_escape_string. After the user arrives at ‘profile.php,’ I am planning on implementing something like this after I can figure out how to properly pass the user id:

$user_id=(int)$_GET['$user_id'];
mysql_real_escape_string($user_id);
if (isset($user_id)) {
   $user_id = preg_replace('#[^0-9]#i', '', $user_id); // filter everything but numbers

There is more to the code, but I believe I have included all relevant information. Any advice, wisdom, thoughts, and comments are always very much appreciated. Thank you very much for your support.

  • 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-05-26T02:42:10+00:00Added an answer on May 26, 2026 at 2:42 am

    You cannot query and get the result right away.

    Try to fix above part as like this.

    $user_id = mysql_query("SELECT `id` FROM `users` WHERE `username` = '$user' AND `active`='1'");
    $user_id = mysql_result($user_id, 0, 'id');  
    header("location: profile.php?test='$user_id'");
    exit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having a small problem, I'm trying to create an inline editing system with
Having a problem trying to create a function, as part of a BizTalk helper
I'm trying to create an application in interface builder, and I'm having a problem.
I'm having a problem using the java.text.MessageFormat object. I'm trying to create SQL insert
Okay, I seem to be having a problem. I'm trying to create a twicker
I'm trying to create a tooltip with jquery. However I'm having a problem that
I am having a problem with javax.xml.transform.Transformer . I am trying to create a
I'm trying to create a social network and I'm having a problem with my
I am having a problem with trying to create new rows in sql server
I'm having problem (basically, I'm confused.) while trying to create a worker thread for

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.