Jump to content

Php/forms


kanie12

Recommended Posts

Hi. I'm having trouble getting a variable($text) to be filled into a form field. I think its because of the form being outside the php tag but im not sure. Hope someone can help. Here is the code:

<?php

require_once("funksjoner.php");

topp();

topp_meny();

$Choo = new mysql();

$Choo->connect();

$result = $Choo->query("SELECT * FROM `kunde` WHERE kunde_id=1");

$row = mysql_fetch_row( $result );

 

$text=($row[1]);

?>

 

<div id='kundeinfo'>

<form action="form.php" method="post">

 

 

<table width="236" border="0" align="center">

  <tr>

    <td width="78"><div align="left">Fornavn:</div></td>

    <td width="148"><div align="center">

      <input type="text" value='$text'/>

    </div></td>

  </tr>

  <tr>

    <td><div align="left">Etternavn:</div></td>

    <td><div align="center">

      <input type="text" name = "etternavn" />

    </div></td>

  </tr>

  <tr>

    <td><div align="left">Gatenavn:</div></td>

    <td><div align="center">

      <input type="text" name = "gatenavn" />

    </div></td>

  </tr>

   <td><div align="left">Postnr:</div></td>

    <td><div align="center">

      <input type="text" name = "postnummer" />

    </div></td>

  </tr>

   <td><div align="left">Telefon:</div></td>

    <td><div align="center">

      <input type="text" name = "telefonnr" />

    </div></td>

  </tr>

   <td><div align="left">Mobil:</div></td>

    <td><div align="center">

      <input type="text" name = "mobi" />

    </div></td>

  </tr>

    <td><div align="left">Epost:</div></td>

    <td><div align="center">

      <input type="text" name = "epost" />

    </div></td>

  </tr>

    <td><div align="left">Passord:</div></td>

    <td><div align="center">

      <input type="text" name = "passord" />

    </div></td>

  </tr>

    <tr>

    <td><div align="left">Kundeid:</div></td>

    <td><div align="center">

      <input type="text" name = "kunde_id" />

    </div></td>

  </tr>

</table>

<br><br><br>

<div align="center">

      <input type="submit" value="Lagre">

      <input name="Reset" type="reset" value="Nullstill" />

</div>

</form></div>

 

Link to comment
https://forums.phpfreaks.com/topic/57065-phpforms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.