Page 1 of 1

some how to question

Posted: Wed Jun 25, 2008 10:22 pm
by Hellbringer
hi,
i am new to php and mysql and i am working on building a website that is a webstore and i have a couple quextion on how to get some things to work

first:
i am working on the administration page and i have made a simple html form that adds the products to the database using php. in my form i have 2 drop down boxes and right now when i submit the form it does not pull the values out of the drop down boxes to be placed in the database. how do you get it to pull the values and place it into a variable.

second: ***added information the form submits to its self***
talking about the same webform...... when i am inserting products to the database i will be doing alot at the same time one after another and some of the information will stay the same for a group of products. is there a way that when the form is submited it retains the information that was entered into the fields so they do not have to be filled out every time.

third:
i am also making a page that will allow me to search the database for a product and display the all the information (ex name, p/n, qty instock, ect.) right now i have the results posting into a table with some of the limited information. i would like to know how to make the name a hyperlink that opens another window that displays all the information for the product?

fourth: and last :D
lastly i am going to be creating a update/delete my idea to do this page is when the product is called to be edited that it will put the values that are in the database into form text boxes so they can be changed and when the form is submitted it changes in the database.

on all these i know how to do the query statements and most of the php what i am looking for is the html get it to do exactly what i wan to do

thanks in advance
Mike

Re: some how to question

Posted: Wed Jun 25, 2008 10:38 pm
by WebbieDave
Hellbringer wrote:how do you get it to pull the values and place it into a variable
If the name of the html select is drop1 you can access the value in PHP with $_REQUEST['drop1']
Hellbringer wrote:is there a way that when the form is submited it retains the information that was entered into the fields so they do not have to be filled out every time
Absolutely. This is quite simple to implement.
Hellbringer wrote:i would like to know how to make the name a hyperlink that opens another window that displays all the information for the product?
PHP's all over this one: <a href="somelink?product_id=<?php echo $product_id?>" target="_blank"><?php echo $product_name ?></a>
Hellbringer wrote:i am going to be creating a update/delete my idea to do this page is when the product is called to be edited that it will put the values that are in the database into form text boxes so they can be changed and when the form is submitted it changes in the database.
Quite common and PHP/MySQL are great solutions for this.
Hellbringer wrote:on all these i know how to do the query statements and most of the php what i am looking for is the html get it to do exactly what i wan to do
You'll definitely want to invest in a nice beginner PHP book as well as a beginner HTML book. I have no doubt that, after reading, you will have the knowledge necessary to do all that you require and much more. If you run into snags while coding, come back and ask us. We'll be glad to help. Best of luck and happy coding!