Problem with form method / RH / Apache
| From: | ludovic | Date: | Thu, 14 Sep 2000 16:26:47 +0000 |
| Subject: | Problem with form method / RH / Apache | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-16806@lists.php.net to get a copy of this message | ||
Hello,
I am working with php 3.16 , RH5.2, apache 1.3.12 freetds( to access on
database) and Sybase ( on WinNT)
When I make an access to my database in order to update value in tables,
I have got problem.
I am going to explain you what I am doing :
My first php file make a request to the database and display the result.
echo "<textarea NAME=LIB_PERSONNE cols=40 rows=1>$id</Textarea></th>";
The user has the possibility to update the textaera LIB_PERSONNE.
To do it, he has to write in the textarea and push the button with the
form method.
The second php file take the new value of LIB_PERSONNE and update the
database and write on the screen
<H4>Recordind made correctly.</H4>
The problem is that when I push on the button the recording is made
correctly but the first page stay on the screen.
The second page is not displayed
I do not understand. What is wrong ?
NB = I used exactly the same php files with IIS and all goes right.
This is my first php3 file
.
.
<form method="post" action="recordpers.php3">
<table>
<tr>
<?php
$qresult = mssql_query($query,$idlink);
/* Boucle tant qu'il y a un enregistrement (ligne) sinon False */
$i = 0;
while ($i < ( mssql_num_rows($qresult)))
{
$j = 0;
while ( $j < ( mssql_num_fields($qresult)))
{
$id = mssql_result($qresult,$i,$j);
$j++;
echo "<th>Civilité :</th><th>";
echo "<textarea NAME=CIVILITE cols=40 rows=1>$id</Textarea></th>";
$id = mssql_result($qresult,$i,$j);
$j++;
echo "</tr><tr><th>Nom :</th><th>";
echo "<textarea NAME=LIB_PERSONNE cols=40 rows=1>$id</Textarea></th>";
$id = mssql_result($qresult,$i,$j);
$j++;
echo "</tr></th></tr>";
}
$i++;
}
echo "</tr></table>";
mssql_free_result($qresult);
mssql_close($idlink);
echo "<INPUT type='hidden' name=id_personne value='$pers'>";
?>
<BR>
<p align="right"><input type="submit"
value="Enregistrer"></p>
.
.
My Second php file
.
.
idlink = mssql_connect($host,$username,$password) or die ("Impossible de
se connecter");
mssql_select_db($basename,$idlink);
$query =
"update org_personne set
org_personne.LIB_PERSONNE='".str_replace("'", "''",
$LIB_PERSONNE)."',
org_personne.CIVILITE='".str_replace("'", "''",
$CIVILITE)."',
where id_personne=$id_personne";
$qresult = mssql_query($query,$idlink);
mssql_free_result($qresult);
mssql_close($idlink);
?>
<H4>Recordind made correctly.</H4>
</body>
.
.