Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

293
Views
User ID with PHP session

How can I save the user Id when is filling a form using PHP (Sessions)?? I mean how do get this session and I write the SQL query to save the uder ID in the form that has been submitted...

This is my session

session_start();
$_SESSION['user_id'] = $data['user_id'];
$_SESSION['first_name'] = $data['first_name'];

and here when the user log in to fill the form

session_start();
if (!isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT']) )) {
    // Need the functions:
    require ('includes/login_functions.inc.php');
    redirect_user();
    // Print a message:
}
echo "<span>You are now logged in, {$_SESSION['first_name']}!<a href=\"logout.php\">Logout</a></p></span>";
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!