/ Forside / Teknologi / Udvikling / PHP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
PHP
#NavnPoint
rfh 3959
natmaden 3372
poul_from 3310
funbreak 2700
stone47 2230
Jin2k 1960
Angband 1743
Bjerner 1249
refi 1185
10  Interkril.. 1146
PHP & MYSQL (update) virker under linux se~
Fra : HULEN


Dato : 31-05-04 20:25

Jeg har en update i en mysql server som virker under linux server men
hvis jeg forsøger på en win32 server så sker der intet, og hvis jeg
forsøger at lave request i ret.php filen ( $knappen =
$_REQUEST["knappen"];) så updater den bare DB med tomme felter ???
her er de 2 filer !

fil : adr_ret.php

<title>Personale</title>
<style>
<!--
table { font-family:verdana; font-size:8pt; color: #000000 }
td { font-family:verdana; font-size:8pt; color: #000000 }
input {
font-family: verdana;
font-size: 8pt;
}
body {
   background-color: #BCC9D3;
}
-->
</style>
<script language="JavaScript">
<!--
function chkForm() {
if(document.vwarform.kontor.value == "")
{
alert("HUSK at vælge kontor");
document.vwarform.kontor.focus();
return false;
}
}
//-->
</script>
<table width="410" border="0">
<tr>
<td>
   <form name="sender" action="knap.php" method="get">
<input style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;" name=""
type="submit" value="-- Personsøgesiden --" >
</form>
   </td>
<td>
   <form name="sender" action="adr.php" method="get">
<input style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;" name=""
type="submit" value="-- Hovedsiden --" >
</form>
   </td>
<td>
   <form name="sender" action="adr_show_all_ret.php"
method="get">
<input style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;" name=""
type="submit" value="-- Ret flere --" >
</form>   </td>
</tr>
</table>
<?php
include("db.inc");
?>
<?php
$knappen = $_REQUEST["knappen"];
$findes=mysql_query("SELECT * FROM adr WHERE id='$knappen'") or die
("Kunne ikke hente fra databasen ??");
while ($fundet=mysql_fetch_array($findes)) {
?>
<body bgcolor="#BCC9D3">
<form method="POST" action="ret.php" name="vwarform" onSubmit="return
chkForm()">
<table border="0" width="800">
<tr>
<td width="280" bgcolor="#aeb5bd"><b>Navn:<br>
</b>
<input type="text" size="30" name="navn" value="<? echo
$fundet["navn"]; ?>"></td>
<td width="300" bgcolor="#aeb5bd"><b>Stilling:<br>
</b>
<input type="text" size="30" name="stilling" value="<? echo
$fundet["stilling"]; ?>"></td>
   <td width="180" bgcolor="#aeb5bd"><b>Lok tlf.<br>
   </b>
    <input type="text" size="30" name="loknr" value="<? echo
$fundet["loknr"]; ?>"></td>
</tr>
<tr>
<td width="280" bgcolor="#aeb5bd"><b>email:<br>
</b>
<input type="text" size="30" name="email" value="<? echo
$fundet["email"]; ?>"></td>
<td width="300" bgcolor="#aeb5bd"><b>Kommentar:<br>
</b>
<input type="text" size="30" name="comment" value="<? echo
$fundet["comment"]; ?>"></td>
   <td width="180" bgcolor="#aeb5bd"><b>Rum:<br>
   </b>
    <input type="text" size="30" name="rumnr" value="<? echo
$fundet["rumnr"]; ?>"></td>
</tr>
</table>
   <table border="0" width="800">
<tr>
<td width="280" bgcolor="#aeb5bd"><b>Tilknyttet kontor:<br>
</b>
</td>
<td width="300" bgcolor="#aeb5bd"><b>Arbejds mobil:<br>
</b>
<input type="text" size="30" name="mobnr" value="<? echo
$fundet["mobnr"]; ?>"></td>
   <td width="180" bgcolor="#aeb5bd"><b>Ansat indtil:<br>
   </b>
    <input type="text" size="30" name="anstil" value="<? echo
$fundet["anstil"]; ?>"></td>
</tr>
<tr>
<td width="280" bgcolor="#aeb5bd">&nbsp;</td>
<td width="300" bgcolor="#aeb5bd">&nbsp;</td>
   <td width="180" bgcolor="#aeb5bd">&nbsp;</td>
</tr>
   </table>
   <table border="0" width="800">
<tr>
<td width="280" bgcolor="#aeb5bd"><b>Privat Adr.<br>
</b>
<input type="text" size="30" name="gade" value="<? echo
$fundet["gade"]; ?>"></td>
<td width="300" bgcolor="#aeb5bd"><b>Priv. tlf.<br>
</b>
<input type="text" size="30" name="telf" value="<? echo
$fundet["telf"]; ?>"></td>
   <td width="180" bgcolor="#aeb5bd"><b>Priv. mobil.<br>
   </b>
    <input type="text" size="30" name="mobil" value="<? echo
$fundet["mobil"]; ?>"></td>
</tr>
<tr>
<td width="280" bgcolor="#aeb5bd"><b>Postnr. og by:<br>
</b>
<input type="text" size="30" name="postnr" value="<? echo
$fundet["postnr"]; ?>"></td>
<td width="300" bgcolor="#aeb5bd"><b>Priv. email:<br>
</b>
<input type="text" size="30" name="emailhj" value="<? echo
$fundet["emailhj"]; ?>"></td>
   <td width="180" bgcolor="#aeb5bd"><b>Fødselsdag:<br>
   </b>
    <input type="text" size="30" name="cprnr" value="<? echo
$fundet["cprnr"]; ?>"></td>
</tr>
   
   </table>
   <input name="knappen" type="hidden" value="<? echo
$fundet["id"]; ?>">
   <input type="submit" style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;"
value="-- Gem person --" name="submit">
   </form>
   <br>
</body>
<?
}
mysql_close($conn);
?>

---------------------------------------------------------------------
fil : ret.php

<title>Personale</title>
<style>
<!--
table { font-family:verdana; font-size:8pt; color: #000000 }
td { font-family:verdana; font-size:8pt; color: #000000 }
input {
font-family: verdana;
font-size: 8pt;
}
body {
   background-color: #BCC9D3;
}
-->
</style>
<table width="410" border="0">
<tr>
<td style="color:black; font-size: 12pt; font-weight: bold; "><div
align="center">Person er nu rettet </div></td>
</tr>
</table>
<table width="410" border="0">
<tr>
<td>
   <form name="sender" action="knap.php" method="get">
<input style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;" name=""
type="submit" value="-- Personsøgesiden --" >
</form>
   </td>
<td>
   <form name="sender" action="adr.php" method="get">
<input style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;" name=""
type="submit" value="-- Hovedsiden --" >
</form>
   </td>
<td>
   <form name="sender" action="adr_show_all_ret.php"
method="get">
<input style="height: 20px; width: 130px;
background-color:rgb(141,147,153); border-width:1px;
border-color:black; color: black; border-style:solid; font-family:
arial; font-weight: bold; font-size: 8pt; text-align: center;" name=""
type="submit" value="-- Ret flere --" >
</form>   </td>
</tr>
</table>
<?php
include("db.inc");
?>
<?php
mysql_query("UPDATE adr SET navn='$navn', stilling='$stilling',
loknr='$loknr', email='$email', comment='$comment', rumnr='$rumnr',
mobnr='$mobnr', anstil='$anstil', gade='$gade', telf='$telf',
mobil='$mobil', postnr='$postnr', emailhj='$emailhj', cprnr='$cprnr'
WHERE id='$id'") or die ("Kunne ikke hente fra databasen ??");
?>
</body>


 
 
Nezar Nielsen (01-06-2004)
Kommentar
Fra : Nezar Nielsen


Dato : 01-06-04 12:15

HULEN wrote:
> Jeg har en update i en mysql server som virker under linux server men
> hvis jeg forsøger på en win32 server så sker der intet, og hvis jeg
> forsøger at lave request i ret.php filen ( $knappen =
> $_REQUEST["knappen"];) så updater den bare DB med tomme felter ???
....
> mysql_query("UPDATE adr SET navn='$navn', stilling='$stilling',
> loknr='$loknr', email='$email', comment='$comment', rumnr='$rumnr',
> mobnr='$mobnr', anstil='$anstil', gade='$gade', telf='$telf',
> mobil='$mobil', postnr='$postnr', emailhj='$emailhj', cprnr='$cprnr'
> WHERE id='$id'") or die ("Kunne ikke hente fra databasen ??");

Det første du siger sammen med den update query du fyrer af kunne jo
godt tyde på at du ikke har slået register globals til på
windows-serveren, men har på linux-serveren.

--
Mvh. Nezar Nielsen
http://fez.dk

Søg
Reklame
Statistik
Spørgsmål : 177501
Tips : 31968
Nyheder : 719565
Indlæg : 6408527
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste