uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Tech Support
       Support Policy
       Knowledge Base
       Reference Sites
       Software Piracy
       Legal Notices
       Privacy Policy
       Reseller Info
       Contact Us
       Site Map
Questions with MySQL, PHP & uShop

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Nov-18-17 10:59 AM EST
Original Message
Questions with MySQL, PHP & uShop
Author Matt on 07-04-2002 at 13:12 (EST)
OK... finally got a domain name setup the way I wanted, got the applets and class files transferred to the domain and ready to roll out. One question, or should I say problem that I've run into.

I am hosted on a Unix box, PHP4, MySQL database tied in. I use PHP extensively throughout the site and this of course is best because it allows me to utilize only a few pages as compared to a few thousand pages!

The problem? Here it is: Over 4,000 items, some jewelry. The jewelry items have sizes ranging from 5-12. The issue, is that I'm currently using the JavaScript Input Example 1 applet customized (, click the shopping link and then choose a category) If I use this ONE applet throughout the site, not EVERY item has a choice for size of course, only the jewelry items. HOW, can I utilize JUST the jewelry items to use an applet that allows for a choice of an option when the (php) page redirects to another php page with the one applet?

Should I be using ELSE IF in the redirecting page in order to determine the applet that should be viewed?

Is there any modification that could be made using the Classification modifier maybe?

Any help would be appreciated... thank you!!


Table Of Contents
  Dynamic applets Microburst Support Team, 2002-07-05 11:25:26 (1)
            Using PHP to select Input Applet Brian Levine, 2002-07-05 12:45:31 (2)
                 Might SEEM easy.... but Matt, 2002-07-05 15:51:40 (3)
                 I've Tried... but no luck! Matt, 2002-07-08 13:26:06 (4)
                      Also... had to remove Matt, 2002-07-08 13:29:48 (5)

Messages In This Discussion
         1. Dynamic applets
        Author Microburst Support Team on 07-05-2002 at 11:25 (EST)
Whether you use the classification modifier to specify sizable jewelry or a database field to flag certain products as sizable jewelry, you are going to have to use an if..else statement to redirect to a page with a different applet that allows the size selection.

I can't think of any other way to do this at the moment, but I'll e-mail you if an idea pops up.

                 2. Using PHP to select Input Applet
                Author Brian Levine on 07-05-2002 at 12:45 (EST)
This seems so straightforward to me that I think that I'm not understanding the problem.

You want to have one input applet type used for jewelry (with sizes) and one for everything else, correct.

If so, the solution is to have a field in the database that flags the item as sizeable. Then on your page where you read item info from the database, check the item type and use an if statement to select the correct input applet:

{? php
// read the data
$row = mysql_fetch_object($result);

// if a sizeable item
if ($row->sizeable == 1)
// display desired input applet
echo "{applet width="160" height="30" code="uShopInput4.class"}n";
// else display standard input applet
echo "{applet width="160" height="30" code="uShopInput3.class"}n";

(note: I used curly brackets instead of angle brackets so the code will display in the forum)
                         3. Might SEEM easy.... but
                        Author Matt on 07-05-2002 at 15:51 (EST)

You're right, it seems easy, if you know what you're doing! I'm fairly new to the PHP programming, so I learn as I go. The page that I use is EXTREMELY heavy in PHP code and pagination. It is somewhat difficult to figure out and to know where to place the code. I've struggeled with it so far, but if you're willing to take a look... let me know!

Thanks for the post though, I'll see if I can stumble through the integration to the page I'm currently using!

Thanks, Matt
                         4. I've Tried... but no luck!
                        Author Matt on 07-08-2002 at 13:26 (EST)

Just wanted to let you know I've been trying to get things right, but the issue is, I can only get the ELSE statement to load, never the first.

I have included the code, modified to my page, with the problem of NEVER having gotten it right?? Anything you could offer would be great. Also, I've tried setting up the IF statement many ways, with no results either. The size field holds information such as "Size 5,Size6" and that's it. So as for the reason I can't get it to work, I couldn't tell you!

Here's the code with {} replacing the gt/lt symbols:


if ($result->ProductSize == 1)
// display desired input applet
echo "{applet width="160" height="30" code="uShopInput4.class" codebase="classes3"}

// else display standard input applet
echo "{applet width="80" height="30" code="uShopInput1.class" codebase="classes3"}
echo "{PARAM NAME="id" VALUE="$ProductCode"}n";
echo "{PARAM NAME="name" VALUE="$ProductName"}n";
echo "{PARAM NAME="description" VALUE="$ProductDescription"}n";
echo "{PARAM NAME="price" VALUE="$DiscountPrice"}n";
echo "{PARAM NAME="classification" VALUE="$Class"}n";
echo "{PARAM NAME="qty" VALUE="1"}n";
echo "{PARAM NAME="shipping_modifier" VALUE="$0.00"}n";
echo "{PARAM NAME="taxable" VALUE="YES"}n";
echo "{PARAM NAME="popup" VALUE="YES"}n";
echo "{PARAM NAME="label" VALUE="Add to Cart"}n";

                                 5. Also... had to remove
                                Author Matt on 07-08-2002 at 13:29 (EST)
I had to remove the


statement, kept giving me a parse error!


© 2003 Microburst Technologies, Inc.