• We've upgraded our forums. Please post any issues/requests in this thread.

HTML Forms

Joined
Jun 30, 2008
Messages
1,135 (0.33/day)
Likes
67
Location
England
System Name Wasleys PC
Processor Intel i5 2400 3.10GHz
Motherboard Asus P8z68-V
Cooling AC Freezer Pro
Memory Kingston 4GB (2x2GB) DDR3 Hyperx Memory
Video Card(s) HIS ATi 6850 1GB DDR3
Storage Seagate ST3500320AS 500GB Hard Drive SATA II 7200rpm *32MB Cache*
Case Antec 900 with mods
Audio Device(s) On Board
Power Supply OCZ Stealth Xtream 500W
Software Windows 7
#1
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
 
Joined
Feb 8, 2012
Messages
2,678 (1.25/day)
Likes
1,914
Location
Zagreb, Croatia
System Name Windows 7 64-bit Core i5 3570K
Processor Intel Core i5 3570K @ 4.2 GHz, 1.26 V
Motherboard Gigabyte GA-Z77MX-D3H
Cooling Scythe Katana 4
Memory 4 x 4 GB G-Skill Sniper DDR3 @ 1600 MHz
Video Card(s) Gainward NVIDIA GeForce GTX 970 Phantom
Storage Western Digital Caviar Blue 1 TB, Seagate Baracuda 1 TB
Display(s) Dell P2414H
Case CoolerMaster Silencio 550
Audio Device(s) VIA HD Audio
Power Supply Corsair TX v2 650W
Mouse Steelseries Sensei
Keyboard CM Storm Quickfire Pro, Cherry MX Reds
Software MS Windows 7 Enterprise 64-bit SP1
#2
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
 
Last edited:

Mindweaver

Moderato®™
Staff member
Joined
Apr 16, 2009
Messages
6,582 (2.08/day)
Likes
3,915
Location
Charleston, SC
System Name Sechs / EyeSeven
Processor i7 5820k @ 4.5ghz / i7 2600k @ 4.0Ghz
Motherboard X99S GAMING 7 / ASRock Z68 Extreme3 Gen3
Cooling CORSAIR Hydro Series H100i Extreme / Stock cooler... H50 leaked!..
Memory G.Skill DDR4 2800 16GB 4x4GB / G.Skill DDR3 1600 8gb 2x4GB
Video Card(s) PNY Quadro K2000 / MSI GTX 970 GAMING 4Gb
Storage Samsung 850 PRO 256GB SSD /Intel 240gb, corsair 120gb SSD, 3x 1 tb s storage
Display(s) 2x Acer G276HL 27" 1080p / 3x Acer 22" Nvidia surround
Case Phanteks “Enthoo Pro series”/ Cooler Master Storm Scout
Audio Device(s) Azalia Realtek ALC1150 / SB X-Fi Gamer
Power Supply Corsair CXM CX600M / Corsair 600w
Mouse Razer DeathAdder Chroma / Razer DeathAdder
Keyboard Razer BlackWidow Ultimate /
Software Windows 10 Pro x64 / Windows 10 Pro x64
#3
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. :toast:
 
Joined
Jun 30, 2008
Messages
1,135 (0.33/day)
Likes
67
Location
England
System Name Wasleys PC
Processor Intel i5 2400 3.10GHz
Motherboard Asus P8z68-V
Cooling AC Freezer Pro
Memory Kingston 4GB (2x2GB) DDR3 Hyperx Memory
Video Card(s) HIS ATi 6850 1GB DDR3
Storage Seagate ST3500320AS 500GB Hard Drive SATA II 7200rpm *32MB Cache*
Case Antec 900 with mods
Audio Device(s) On Board
Power Supply OCZ Stealth Xtream 500W
Software Windows 7
#4
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).
 
Last edited:
Joined
Jun 30, 2008
Messages
1,135 (0.33/day)
Likes
67
Location
England
System Name Wasleys PC
Processor Intel i5 2400 3.10GHz
Motherboard Asus P8z68-V
Cooling AC Freezer Pro
Memory Kingston 4GB (2x2GB) DDR3 Hyperx Memory
Video Card(s) HIS ATi 6850 1GB DDR3
Storage Seagate ST3500320AS 500GB Hard Drive SATA II 7200rpm *32MB Cache*
Case Antec 900 with mods
Audio Device(s) On Board
Power Supply OCZ Stealth Xtream 500W
Software Windows 7
#5
Problem Solved. Thanks
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
17,057 (3.44/day)
Likes
17,962
Processor Core i7-4790K
Memory 16 GB
Video Card(s) GTX 1080
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 7
#6
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
 
Joined
Feb 8, 2012
Messages
2,678 (1.25/day)
Likes
1,914
Location
Zagreb, Croatia
System Name Windows 7 64-bit Core i5 3570K
Processor Intel Core i5 3570K @ 4.2 GHz, 1.26 V
Motherboard Gigabyte GA-Z77MX-D3H
Cooling Scythe Katana 4
Memory 4 x 4 GB G-Skill Sniper DDR3 @ 1600 MHz
Video Card(s) Gainward NVIDIA GeForce GTX 970 Phantom
Storage Western Digital Caviar Blue 1 TB, Seagate Baracuda 1 TB
Display(s) Dell P2414H
Case CoolerMaster Silencio 550
Audio Device(s) VIA HD Audio
Power Supply Corsair TX v2 650W
Mouse Steelseries Sensei
Keyboard CM Storm Quickfire Pro, Cherry MX Reds
Software MS Windows 7 Enterprise 64-bit SP1
#7
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 :toast:
 

Zygmunt

New Member
Joined
Jul 19, 2013
Messages
8 (0.00/day)
Likes
1
#8
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.
 
Last edited:
Joined
Dec 2, 2009
Messages
3,257 (1.11/day)
Likes
315
System Name Mercury KM-81
Processor Phenom II x4 B50
Motherboard ASUS M4A89GTD PRO
Cooling Cooler Master Hyper TX3
Memory 6GB Ram (4GBx1 Corsair 2GBx1 Nanya)
Video Card(s) PowerColor AX6770 V2.0
Storage 2TB WD Black, 1TB Hitachi, 500 GB WD Blue
Display(s) Philips 247E-LPH 24" 1920x1080
Case Mercury
Audio Device(s) Integrated Realtek
Power Supply Corsair 750TX
Software Windows 7 64-bit
Benchmark Scores Maybe it is time to benchmark :D
#9
Just a question which would somewhat interest me
What are the prices of websites where you guys live?