Question
-
Topic
-
How to use session variables to in properties of HTML form input
In the PHP plugin file, I’m setting two session variables:
$_SESSION[‘snameclr’] =”black”;
$_SESSION[‘sNameEnab’] =False;I want to use these variables in an HTML form:
Snameclr will be the background of an element;
sNameEnab specifies whether the input is enabled.This is the HTML line defining the input:
<td><input type=”text” name=”sname” id=”sname” maxlength=”25″ value=”<?PHP
echo $_SESSION[‘sname’];?>” DISABLED required
style=”background-color<?php $_SESSION[‘snameclr’]?>
;”The WordPress page says “unexpected token “}” which I presume because the use of snameclr is ioncorrect; how can I correct this?
How can I use sNameEnab to set whether the input is enabled? Thanks for any ideas
All Answers
Viewing 1 reply thread