Click to See Complete Forum and Search --> : Need help on an idea
Cricket
10-16-2003, 01:20 PM
My company manufactures products and wants the website for buyers to use. They want their catalog on there, and have passwords to access their catalog. There will be 2 types of password. One for Big Buyers to use which reveals lower pricing, and another for Small Buyers to use which reveals higher pricing. Is that possible to do?
Do I use Cold Fusion for this? Or what is the best programming language to use for this?
Thanks. :)
spufi
10-16-2003, 01:36 PM
You can use a server side language with a database to do it. For the login info, you can create a table which has the user's info on it. Let's say you have at least three fields, customer id, password, and type of buyer. When a customer tries to login, you can check to see if they are on your database, or not, and see if they typed in their password correctly. When a customer tries to order something, you then can check to see what kind of buyer they are(big, or small).
Daria
10-16-2003, 02:00 PM
Miva Merchant available to purchase has a great possibilities for multiple stores, etc. The price for the shopping card depends on your needs, but it may worth it, depending on your needs, and you can build the price in the development schedule, since you'll need to fill in the store. It may be an aswer if you are open to an idea of not writing your own code.
Cricket
10-16-2003, 02:05 PM
The site will only show pricing, but 2 different sets. When I said "Buyers," I meant to say "Retailers." :) Retailers will use the site for info only. There will be no shopping carts.
Cricket
10-16-2003, 02:09 PM
Originally posted by spufi
You can use a server side language with a database to do it. For the login info, you can create a table which has the user's info on it. Let's say you have at least three fields, customer id, password, and type of buyer. When a customer tries to login, you can check to see if they are on your database, or not, and see if they typed in their password correctly. When a customer tries to order something, you then can check to see what kind of buyer they are(big, or small).
Hmm....I kinda get what you're saying. My brain is almost working now. :)
Cricket
10-16-2003, 02:09 PM
Originally posted by spufi
You can use a server side language with a database to do it. For the login info, you can create a table which has the user's info on it. Let's say you have at least three fields, customer id, password, and type of buyer. When a customer tries to login, you can check to see if they are on your database, or not, and see if they typed in their password correctly. When a customer tries to order something, you then can check to see what kind of buyer they are(big, or small).
Hmm....I kinda get what you're saying. My brain is almost working now. :)
Daot Lagorille
10-17-2003, 08:08 AM
This seems pretty straighforward.
If it is only a question of displaying information that depends on who is viewing, you could do this with javascript.
Like, you let group 1 know the "password" which they can enter, which will then act as a session variable or something, maybe a cookie.
Then it is just a question of doing an "if then" statement to display the correct prices.
Cricket
10-17-2003, 11:33 PM
Umm...but if I use the IF, THEN statements, there will be too many to list for the pricing. I want it to connect to a database somehow, so it can grab the pricing info there.
Database fields could be: productid, bigbuyerprice, smallbuyerprice.
I don't want to use ASP because I don't know it well.
PunkSktBrdr01
10-18-2003, 10:34 AM
When the person logs in, use setcookie() (http://us4.php.net/manual/en/function.setcookie.php) to set a cookie that tells whether the person is a big buyer or a small buyer, like this:
setcookie("buyer", $buyer_type);
Then just run some if/else statements to query the database, like this:
<?
if (!isset($_COOKIE['buyer'])) {
echo "You do not have permission to view this page!";
}
else {
$buyer_type = $_COOKIE['buyer'];
$pricing = ($buyer_type == "big") ? "bigbuyerprice" : "smallbuyerprice";
$connection = mysql_connect("server", "user", "pass");
mysql_select_db("db", $connection);
$query = "SELECT " . $pricing . ", products FROM table_name";
$result = mysql_query($query);
$products = array()
while ($price = mysql_fetch_array($result)) {
$products[$price['products']] = $price[$pricing];
}
}
?>
That should do what you want. To show the products and prices, you can do this:
<?
foreach ($products as $key => $val) {
echo "<b>" . $key . "</b> : " . $val . "<br><br>\n";
}
?>
Hope that helps!
Cricket
10-19-2003, 01:21 PM
PHP? :( But... I don't know PHP. Do I just copy and paste what you have? Also, I don't think our website supports PHP. Any other language to use? Sorry to be such a pain, but thanks for all the tips guys. :)
PunkSktBrdr01
10-19-2003, 02:53 PM
Well, if you can't use PHP, and you don't like ASP, you can try ColdFusion, or perl, or something else. I only know PHP. What languages does your server support?