0

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:

  • Userid
  • Itemid
  • Bidamount

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.

2
  • you get this $_SESSION['userid'] not by PHP. do you use some framework or tutorial code etc.? Commented Apr 17, 2012 at 18:52
  • Your question title "Database management php mysql" doesn't suit the contents of the question. Commented Apr 17, 2012 at 18:56

2 Answers 2

1

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'];
Sign up to request clarification or add additional context in comments.

Comments

0

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

6 Comments

thanks, i dont have a form in the item.php page,is there any other way other than form ,that will pass the itemid of the item whose bid option is clicked,to the bid.php page..thanks
"you would create a from". Must be form. Isn't it?
a form is not necessary for this functionality, you can just use an href tag.
how are you sending the data then? what link are you using? You could also use a url variable when you are generating a link.
yes a url variable is another way to approach this functionality. you can also add some ajax
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.