Where to put php code inside html code
Posted: Thu Jun 18, 2009 5:09 am
Hi, i'm a newbie on this, i'm working with LDAP, and need to create an instance of a Class A that allows me to show or hide a field in an html form.
My problem is quite simple: i don't know where to put the <?php $hd = new A(); ?>.
Should i put it in the header??
Thanks.
Dámaris.
This is the first part of my html code:
My problem is quite simple: i don't know where to put the <?php $hd = new A(); ?>.
Should i put it in the header??
Thanks.
Dámaris.
This is the first part of my html code:
Code: Select all
<?php
require_once("setVisibility.php");
require_once("Hidden.php");
?>
<html>
<head> <title> Persona </title>
<link rel="stylesheet" type="text/css" href="estilo_formulario.css" />
</head>
<body>
<form action="tratarPersona.php" method="post" type="text" >
<fieldset><legend align="left"> Datos personales </legend>
<div <?php if($hd->getName() == true) {$tipo = "hide";} else {$tipo = "show";} ?> CLASS=<?php echo $tipo ?> id="div_name" >
<label id="label_name" for="name"> Nombre </label>