• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

HTML Forms

Joined
Jun 30, 2008
Messages
1,145 (0.20/day)
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
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
3,012 (0.68/day)
Location
Zagreb, Croatia
System Name Windows 10 64-bit Core i7 6700
Processor Intel Core i7 6700
Motherboard Asus Z170M-PLUS
Cooling Corsair AIO
Memory 2 x 8 GB Kingston DDR4 2666
Video Card(s) Gigabyte NVIDIA GeForce GTX 1060 6GB
Storage Western Digital Caviar Blue 1 TB, Seagate Baracuda 1 TB
Display(s) Dell P2414H
Case Corsair Carbide Air 540
Audio Device(s) Realtek HD Audio
Power Supply Corsair TX v2 650W
Mouse Steelseries Sensei
Keyboard CM Storm Quickfire Pro, Cherry MX Reds
Software MS Windows 10 Pro 64-bit
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
8,193 (1.50/day)
Location
Charleston, SC
System Name Tower of Power / Sechs
Processor i7 14700K / i7 5820k @ 4.5ghz
Motherboard ASUS ROG Strix Z690-A Gaming WiFi D4 / X99S GAMING 7
Cooling CM MasterLiquid ML360 Mirror ARGB Close-Loop AIO / CORSAIR Hydro Series H100i Extreme
Memory CORSAIR Vengeance LPX 32GB (2 x 16GB) DDR4 3600 / G.Skill DDR4 2800 16GB 4x4GB
Video Card(s) ASUS TUF Gaming GeForce RTX 4070 Ti / ASUS TUF Gaming GeForce RTX 3070 V2 OC Edition
Storage 4x Samsung 980 Pro 1TB M.2, 2x Crucial 1TB SSD / Samsung 870 PRO 500GB M.2
Display(s) Samsung 32" Odyssy G5 Gaming 144hz 1440p, ViewSonic 32" 72hz 1440p / 2x ViewSonic 32" 72hz 1440p
Case Phantek "400A" / Phanteks “Enthoo Pro series”
Audio Device(s) Realtek ALC4080 / Azalia Realtek ALC1150
Power Supply Corsair RM Series RM750 / Corsair CXM CX600M
Mouse Glorious Gaming Model D Wireless / Razer DeathAdder Chroma
Keyboard Glorious GMMK with box-white switches / Keychron K6 pro with blue swithes
VR HMD Quest 3 (128gb) + Rift S + HTC Vive + DK1
Software Windows 11 Pro x64 / Windows 10 Pro x64
Benchmark Scores Yes
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,145 (0.20/day)
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
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,145 (0.20/day)
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
Problem Solved. Thanks
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
26,956 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
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
3,012 (0.68/day)
Location
Zagreb, Croatia
System Name Windows 10 64-bit Core i7 6700
Processor Intel Core i7 6700
Motherboard Asus Z170M-PLUS
Cooling Corsair AIO
Memory 2 x 8 GB Kingston DDR4 2666
Video Card(s) Gigabyte NVIDIA GeForce GTX 1060 6GB
Storage Western Digital Caviar Blue 1 TB, Seagate Baracuda 1 TB
Display(s) Dell P2414H
Case Corsair Carbide Air 540
Audio Device(s) Realtek HD Audio
Power Supply Corsair TX v2 650W
Mouse Steelseries Sensei
Keyboard CM Storm Quickfire Pro, Cherry MX Reds
Software MS Windows 10 Pro 64-bit
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)
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,351 (0.64/day)
System Name Dark Stealth
Processor Ryzen 5 5600x
Motherboard Gigabyte B450M Gaming rev 1.0
Cooling Snowman, arctic p12 x2 fans
Memory 16x2 DDR4 Corsair Dominator Pro
Video Card(s) 3080 10gb
Storage 2TB NVME PCIE 4.0 Crucial P3 Plus, 1TB Crucial MX500 SSD, 4TB WD RED HDD
Display(s) HP Omen 34c (34" monitor 3440x1440 165Hz VA panel)
Case Zalman S2
Power Supply Corsair 750TX
Mouse Logitech pro superlight, mx mouse s3, Razer Basiliskx with battery
Keyboard Custom mechanical keyboard tm680
Software Windows 11
Benchmark Scores 70-80 fps 3440x1440 on cyberpunk 2077 max settings
Just a question which would somewhat interest me
What are the prices of websites where you guys live?
 
Top