Forum Moderators: coopster

Message Too Old, No Replies

my first form

step by step.

         

Webber

10:49 am on Dec 30, 2007 (gmt 0)

10+ Year Member



I want to put an order form to my website, but I am still very new to php.
Of course, I have found many form genereators and form templates, but I prefer to do it by myself. If there are problems or changes in the future, I'll be able to deal with it.
I have found many tutorials on forms, but of course,they do not have exactly the form I need. I just would like to know in which order I would do a form properly; a step-by-step guide... because I am a little confused. HTML forms, css styling, mysql database, paypal checkout..... It is way above my head. I am willing to learn it, but do not know where to start.

(I want to make an order form with dropdown menu or radio buttons, and that includes a file upload box, calculates the price and has PayPal check out. )

PHP_Chimp

4:18 pm on Dec 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your end goal is quite a large goal. So you should break it down into smaller sections.
First -
Do you already have the form made? Just the raw HTML to display the form to your customers?

If you dont then that is where to start. As calculating the price will be done on the user input...so if there is no where for an input to take place then dont worry about calculating it just yet ;)

CSS is all about the layout of the form. So again, if you have no form to lay out then I wouldnt worry about how it is going to look.

So HTML first.
Then either CSS or PHP after. They do different things, so it doesnt matter what order you do them in. You may want to do PHP first as this actually affects the workings of your finished product, however seeing as you may well be spending a lot of time looking at the form you may want to get it looking correct first...up to you.

If you have the HTML done then post just the form part up and im sure you will get some hints as to where to go from there.

Webber

2:49 pm on Jan 2, 2008 (gmt 0)

10+ Year Member



So, I'll get a simple HTML form up first.
Make it look nice with CSS.
Then get each item to do what I want it to do by adding PHP.
And then I create the databases where the input goes.
And finally add some PHP magic to get the output right.

I'll give it a try.

Thanks a lot!

Webber

12:33 pm on Jan 13, 2008 (gmt 0)

10+ Year Member



ok,
I got so far that I have created my order form.
And the data will be inserted in to my database.
I followed many tutorials, but still have some questions.

Because I would like to calculate the price from the data that is inserted in the database, would it be better to echo the data on a new page, instead of the same?

And how would I do this? How do I tell the page with the form to go to the new url?

I think it would be best to use a new page that echos the data and then calculates the price and then add the paypal button. In this way, I can keep the code separated on to different pages.

On the new page do I use something like:

$result = mysql_query("SELECT * FROM

or

echo

to display the data entered?

Better to retrieve the data from the database? Or direct from the form?

Webber

2:29 pm on Jan 13, 2008 (gmt 0)

10+ Year Member



Well, I'm a few tutorials down the line and found all the answers already.

Wasn't that difficult in the end.