Jump to content

php selecting products using the post mode


xtoc

Recommended Posts

My product table looks like this :

Id - productname - distributor - comments - genre

 

What i want is to create a select link after each product, when i click on this link, it should

 

Id - productname - distributor - comments - genre  - link

---------------------------------------------------------

1  - dragonfly    -  coltnet      - none        - fantasy - MySelectLinkHere

2  - mystery      -  forunit      - none        - horror  - MySelectLinkHere

 

By pressing MySelectLinkHere on the id "2" -> it will give a overview from product 2, and give you the possibility to order it

 

Is this possible to do this by using the post command?

 

 

thx,

greetz

$_POST is slightly more secure than GET, as less random users will know how to edit post data. Plus it looks nicer to the user than having all that junk in the URL.

 

But to answer the original question, you'd have to make forms, and use javascript to give that link a submit function onclick. In this case, it'll be easier to use the URL and get the data with GET

$_POST is slightly more secure than GET, as less random users will know how to edit post data. Plus it looks nicer to the user than having all that junk in the URL.

 

But to answer the original question, you'd have to make forms, and use javascript to give that link a submit function onclick. In this case, it'll be easier to use the URL and get the data with GET

 

agreed.

Ceps option is the easiest and probably best, although it will need another page.  But passing info like <a href="page.php?option=2">Client</a> can supply info to your php to bring up the relevant product info into your template.  It can also be done via a button and having a func in your script to grab it, like if (isset($_POST['buy'])) then having a switch case for each 'buy' id.

 

Hope that helps

Ceps option is the easiest and probably best, although it will need another page.  But passing info like <a href="page.php?option=2">Client</a> can supply info to your php to bring up the relevant product info into your template.  It can also be done via a button and having a func in your script to grab it, like if (isset($_POST['buy'])) then having a switch case for each 'buy' id.

 

Hope that helps

 

that's using the $_GET method...

$_GET['option']

thanks for all responds

 

I want to use the same page when i showing the product details from one product .

 

when going to the products.php -> select * from products; 

when pressing the second product out of the product list -> reload products.php with sql : select * from products where id = "2";

 

 

greetz

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.