PHP variable from HTML element? (NOT Input)

时间:2016-10-15 17:23:36

标签: php html variables

I'm designing a website for a restaurant. You can make a reservation for how many people and at what time. For the people one, there's a <span> class that will have a number from 1 to 20 that the user can adjust.

I already know about the $_POST method for input fields and those are working just fine. However, I'm not a back-end developer my nature and thus don't know a whole lot about PHP. I can't seem to find a way to make a variable from the element with PHP.

With JavaScript it'd be as simple as $var = $("span"); or what have you. I'm not exactly sure how to do this with PHP.

To be clear, I want to make the contents of this span element into a variable for PHP. The $_POST method doesn't appear to work for non-input fields.

If anyone can help me out with this, that'd be great.

0 个答案:

没有答案