I am new to php, and am writing a form for my co-workers. I wrote a function to format the information into html code so I don't have to write 50+ lines of code over and over again.
Unfortunately, one of the variables that I am passing to the function has html tags in it that seems to be screwing up the code.
here is the function that I wrote:
function format($tasktime,$task,$platform,$action,$name,$count) //this is the function that creates the web
{
print ('<form method=post action="nights.php">'); // page output for the tasklist.
print ('<tr><td width="80">');
print ($tasktime);
print ('<td width="80">');
print ($task);
print ('<td width="80">');
print ($platform);
print ('<td width="300">');
print ($action);
print ("<td width=80><input type=text NAME=name size=10 value=$name>");
print ('<td width="80"><input type="submit">');
print ('<input type=hidden NAME=count value=');
print ($count);
print ('>');
print ('<input type=hidden NAME=tasktime value=');
print ($tasktime);
print ('>');
print ('<input type=hidden NAME=action value=');
print ($action);
print ('>');
print ('<input type=hidden NAME=platform value=');
print ($platform);
print ('>');
print ('<input type=hidden NAME=task value=');
print ($task);
print ('>');
print ('</form>');
}
The variable that is being mis-interpreted is
<a href=hrly.html>Perform hourly checks</a>
or
<ul><li>Check logs/ports</li></ul>
Could anyone please tell me what I have done wrong? I've tried escaping the ">", but that doesn't seem to solve the problem.