Jump to content

[SOLVED] HTML Form + PHP + PostgreSql functions [Help needed][Solved]


triplikeido

Recommended Posts

Hi there.

I'm having a lot of trouble because I can't get my php page receive some variables from the html form. Need help please.

 

Here is the form:

<FORM METHOD="POST" ACTION="quota.php">

<TABLE BORDER="1">

<TR>

<TD>Ano:</TD>

  <TD> <INPUT TYPE="TEXT" Name="Ano" ID="Ano" SIZE="50"></TD>

 

  </TR>

  <TR>

    <TD>Valor da Quota:</TD>

    <TD>

      <INPUT TYPE="TEXT" Name="Valor" ID="Valor" SIZE="50"/></TD>

  <TD><input type="submit" Value="Inserir Quota"/></TD>

</TR>

 

To receive the arguments in:

 

<?

 

$Ano = $POST['Ano'];

$Valor = $POST['Valor'];

echo "$Ano<br>";

echo "$Valor<br>";

 

$conn_str = "host=******** port=5432 user=u57976 password=***** dbname=u57976";

 

$connection = pg_connect($conn_str)

or die("Couldn’t connect to server");

 

$query = "INSERT INTO quota VALUES($Ano, $Valor)";

$result = pg_query($query)

or die ("Not succeeded");

 

?>

 

How can i fix this?

Thanks.

 

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.