www.uburst.com www.uburst.com

"Questions with MySQL, PHP & uShop"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Programmer Tips
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Questions with MySQL, PHP & uShop"
Posted by Matt on Jul-04-02 at 01:12 PM (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 (http://www.giftedunicorn.com, 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!!

Matt

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

Dynamic applets, Microburst Support Team, Jul-05-02, (1)
Using PHP to select Input Applet, Brian Levine, Jul-05-02, (2)
Might SEEM easy.... but, Matt, Jul-05-02, (3)
I've Tried... but no luck!, Matt, Jul-08-02, (4)
Also... had to remove , Matt, Jul-08-02, (5)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "Dynamic applets"
Posted by Microburst Support Team on Jul-05-02 at 11:25 AM (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.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "Using PHP to select Input Applet"
Posted by Brian Levine on Jul-05-02 at 12:45 PM (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
// else display standard input applet
echo "{applet width=\"160\" height=\"30\" code=\"uShopInput3.class\"}\n";
endif;
?}

(note: I used curly brackets instead of angle brackets so the code will display in the forum)

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "Might SEEM easy.... but"
Posted by Matt on Jul-05-02 at 03:51 PM (EST)
Brian,

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

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
4 . "I've Tried... but no luck!"
Posted by Matt on Jul-08-02 at 01:26 PM (EST)
Brian,

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:

{?
$result=mysql_fetch_array($query2);

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

else
// else display standard input applet
echo "{applet width=\"80\" height=\"30\" code=\"uShopInput1.class\" codebase=\"classes3\"}
\n";
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";

?}

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
5 . "Also... had to remove "
Posted by Matt on Jul-08-02 at 01:29 PM (EST)
I had to remove the

endif;

statement, kept giving me a parse error!

Thanks

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.