Jump to content
  • Advertisement
Sign in to follow this  
_jinx_

[web] PHP Help

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

www.jonathangoldsboro.com/php/index.php Thanks to anyone who can help on this. The link above points you to a very simple script I need. Basically the database needs to be stored in an array of 5 products. When the item changes it should automatically load the summary and price, then when a person clicks details, more data will show and a contact order form will be loaded, already viewed when details link is chosen. Any help is appreciated, if you have any questions or would like to help you can contact me on AIM: born4BMW, I will be on the entire day working on it. I do not really know PHP at all and this is really important that I get done, I am not asking for all the answers just a little guidance. Thanks Again!!

Share this post


Link to post
Share on other sites
Advertisement
First of all, you store the products in the database, not backwards (sorry to be so picky [embarrass])

Now, how do you change the summary? Your easiest option here (and If I understand your question well) is to use javascript. Basically, when index.php is being loaded, you connnect to the database, retrieve the 5 product descriptions, and store 'em into javascript arrays, then you use this info so that everytime the user picks up a different item in the select box, you change the description on the fly.

There used to be a site called Code_Punk that explained this well, but it seems like its down ATM, so, I used google cache (thank you google!)

javascript Arrays
Select Boxes

From the last link, check out the piece "onChange Technique" which is the one should interest you most.

Obviously, theres plenty of JS sites out there, just that I like this one in particular.

And if you knew JS already, my bad [embarrass]
So far I see you've been doing it with a submit button, but if its gonna be just a few products, I think the select box should look better

As for the details part... there are many ways to do this.
The way Id do it, is that everytime the user selects an item, you would rewrite the "details" link, so that it will pass a variable (id?) to new.php, then with that variable you should know what to do in order to show the detailed description.

Hope it helps, cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!