Re: Variable from PHP to HTML...

From: Date: Tue, 12 Nov 2002 22:05:48 +0000
Subject: Re: Variable from PHP to HTML...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-23268@lists.php.net to get a copy of this message
<form name="form1" method="post" action=""> <table border="0" align="center"> <?php do {
    $sys = $system['Name'];
    if ($cnt == 1) {
        $cnt = 2;
        echo "<tr>"; ?>
    <td width="161"><input name="$sys" type="checkbox" value="name">
      <?php echo $sys; ?></td>
Your input box should be the following:
<input name="sys" type="checkbox" value="name">
The $ isn't necessary in the HTML code since HTML doesn't really recognize this as a variable. When the form is passed to the action page, the code in the action page (in this case PHP) creates a variable named whatever the name attribute in the HTML code holds - in this case sys. -Lisi

« previous php.db (#23268) next »