Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i check if an element is visible in php? [duplicate]

Tags:

html

php

i have a couple of variables that i want to save or not save to a database depending on whether or not i have set them as hidden/visible in a javascript function, i have searched for a while but cant find anything. Thanks!

like image 575
user1445218 Avatar asked Feb 19 '23 21:02

user1445218


1 Answers

That's absolutely impossible since PHP runs on the server while JavaScript and CSS are client-side.

The only thing you can do is checking if the element is visible using JavaScript and sending that data to your PHP script, e.g. via a hidden <input> field.

like image 172
ThiefMaster Avatar answered Mar 25 '23 05:03

ThiefMaster