I want to use input data which get from <input type="text" name="n" > but following php code does not work. Please help me. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

I want to use input data which get from <input type="text" name="n" > but following php code does not work. Please help me.

get data from <input type="text" name="n" > and use it in <style type="text/css">.layer:after{content:<?php $name = $_REQUEST['n']; echo $name; ?>;} </style> or, Can I use MySQL database data in it?

21st Feb 2018, 2:26 AM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
2 Answers
+ 6
Are you running the code in Code Playground? FYI Code Playground doesn't support form submission process. If you're running that in your machine then I suggest you to check which method is used by the HTML form to submit data. If form method is POST then in PHP code you check the $_POST array, and if the form method is GET you check the $_GET array. Anyways, I noticed you posted this question twice, I would ask you to please remove the duplicate as it is not ethical to do, you may be considered spamming instead. https://www.sololearn.com/Discuss/1089291/?ref=app Hth, cmiiw
21st Feb 2018, 6:16 AM
Ipang
21st Feb 2018, 7:32 AM
Satish Kumar Sharma
Satish Kumar Sharma - avatar