# HTML Forms



## Wozzer (Jun 28, 2013)

Hi All,

I've developed a breif website to monitor the whereabouts of our company laptops. Just have a quick question.

I'm using an HTML form with the POST method to insert data into the database. Once submitted, the page is re-directed to a page which the user can print. (ie - something for them to sign).

I'm trying to automatically populate some fields based on what they inserted on the previous page. (ie - laptop number, etc).

Any ideas on how to do this? I thought it would be the GET method, but I can't seem to get it to work.

More than happy to post my code if required.

Cheers


----------



## BiggieShady (Jun 28, 2013)

When the form posts, after the script on the server side inserts to database, instead of doing simple redirect, script can generate your printable html page with content (including fields and their initial values) based on input posted by the form ... you can mix html markup with script code so you won't need to generate all of html

edit: what you are trying, redirecting using GET with all parameters (laptop number etc.), should also work


----------



## Mindweaver (Jun 28, 2013)

What are you using a Windows or linux based website? (_php or asp_)

*EDIT: If you don't know about it you can go to W3Schools and get a lot of good info. *


----------



## Wozzer (Jun 28, 2013)

Thanks for the responses. Using PHP.

When you say script - Do you mean like a Javascript script?

At the moment - The user enters details, submits to database and on the submit button being pressed - it directs the user to a new page (which has a template they can print out). The template includes fields like date, laptop ID, etc - which if possible, i'd like to be automatically filled from the previous inputs.

(ie - Essentially what you said BiggieShady - Just unsure what script you mean).


----------



## Wozzer (Jun 28, 2013)

Problem Solved. Thanks


----------



## W1zzard (Jun 28, 2013)

You can either put the data into the PHP session ($_SESSION), or just pass them to the next page in the query string (index.php?foo=bar&baz=qux) which will then appear in $_GET

unless it's sensitive data, i'd use the query string

oh and just to make sure header('Location: index.php'); to redirect, don't use some strange meta redirect stuff

edit: if you store the user's input in the database, then just redirect him to the "view database entry" page with the previously inserted database id in the query string


----------



## BiggieShady (Jun 28, 2013)

Wozzer said:


> Thanks for the responses. Using PHP.
> 
> When you say script - Do you mean like a Javascript script?
> 
> (ie - Essentially what you said BiggieShady - Just unsure what script you mean).



I meant PHP script (mixed html/php).
I'm glad you worked it out


----------



## Zygmunt (Jul 19, 2013)

*Programming Language*

Now a days Java is becoming most popular programming language in development field. PHP is going back and Java is coming on front and now in smart phones Java is first priority.
Lifestyle
Glenvale Supported Living
182-184 Hursley Road Toowoomba QLD 4350 Australia
Phone : +61 1300 765 051
http://www.glenvalesupportedliving.com.au/
Providing community aged care supported living housing in Toowoomba, the Glenvale Villas are the perfect option for your loved ones, if they need a little extra help with daily living.


----------



## GSquadron (Jul 19, 2013)

Just a question which would somewhat interest me
What are the prices of websites where you guys live?


----------

