Jump to content

Link the reference id with user


saran.tvmalai

Recommended Posts

Dear All,

 

Am new to PHP. now i want to online cargo tracking system in php. in that i create the reference id for each user to track the shipments. in that user must login and track the shipments. now i need the code for the specific user only view they shipments only. the other user can't be check the other shipments. so i need how to link the user and reference id. kindly advice me.

Link to comment
Share on other sites

for example there are two users. user1 and user2. both have different reference id.

 

user1 have the reference id is 001

 

user2 have the reference id is 002

 

if user1 login and track his shipment means they only possible to view his ref id 001. user1 never possible to check ref id 002. same as user2 never possible to check the ref id 001.

Link to comment
Share on other sites

you are going to need a login page and a member page

 

for the login page use something like

<html>
<form method="post" action="memberpage.php">
Name:<input type="text" name="user">
Password:<input type="password" name="pass">
<input type="submit" value="submit" name="submit">

 

then in your member page you will have something like

 

$con = mysql_connect("localhost","login","pass");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("my_db", $con);


$user = $_POST['user'];
$pass = $_POST['pass'];

$result = mysql_query("SELECT * FROM yourtable WHERE user = $user, pass = $pass");

while($row = mysql_fetch_array($result))
  {
  echo $row['refID'];
  }


 

 

that should give you a good start

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.