Learner
Learner

Reputation: 569

Database management php mysql

I started learning Php scripting today only,i want to create an auction website for my college. I have a bid table having the following columns:

When a user logs in ,and goes to "Items.php" page and when he will click on the bid option on an item (each item has an itemid)he will be redirected to "bid.php" page.
My doubt is: I will get the useid by $_SESSION['userid'], will i similarly also get the itemid automatically by the $_SESSION['itemid'], if not how do i pass the itemid to the bid.php page.

Upvotes: 0

Views: 227

Answers (2)

magicianiam
magicianiam

Reputation: 1579

another way is to to use an href tag to pass a variable to your bid.php and fetch it using get.

i.e <a href ="bid.php?id=1">Bid now!</a>

in your bid.php

    $id = $_GET['id'];

Upvotes: 1

Daniel
Daniel

Reputation: 35684

you would create a from and use POST or GET information that is passed by the form. you would not get this from session

here's a tutorial: http://www.tizag.com/phpT/postget.php

Upvotes: 0

Related Questions