jeg får en blank side
hej eksperterproblemet er at når jeg kører gem.php er siden blank.
gem.php
<?php
require("./gbog-ting/mysql-funktioner.php");
require("./gbog-ting/design-funktioner.php");
require("./gbog-ting/indstillinger.php");
/*
* Foerst napper vi variablerne fra miljoet.
*/
if(is_array($HTTP_POST_VARS)) {
$profilnavn = $HTTP_POST_VARS['profilnavn'];
$navn = $HTTP_POST_VARS['navn'];
$alder = $HTTP_POST_VARS['alder'];
$height = $HTTP_POST_VARS['height'];
$weight = $HTTP_POST_VARS['weight'];
$email = $HTTP_POST_VARS['email'];
$shirtno = $HTTP_POST_VARS['shirtno'];
$position = $HTTP_POST_VARS['position'];
$idol = $HTTP_POST_VARS['idol'];
$klub = $HTTP_POST_VARS['klub'];
$favchang = $HTTP_POST_VARS['favchang'];
$status = $HTTP_POST_VARS['status'];
$unger = $HTTP_POST_VARS['unger'];
$personlig = $HTTP_POST_VARS['personlig'];
$chang = $HTTP_POST_VARS['chang'];
$minde = $HTTP_POST_VARS['minde'];
$ord = $HTTP_POST_VARS['ord'];
$besked = $HTTP_POST_VARS['besked'];
} elseif (is_array($_POST)) {
$profilnavn = $_POST['profilnavn'];
$navn = $_POST['navn'];
$alder = $_POST['alder'];
$height = $_POST['height'];
$weight = $_POST['weight'];
$email = $_POST['email'];
$shirtno = $_POST['shirtno'];
$position = $_POST['position'];
$idol = $_POST['idol'];
$klub = $_POST['klub'];
$favchang = $_POST['favchang'];
$status = $_POST['status'];
$unger = $_POST['unger'];
$personlig = $_POST['personlig'];
$chang = $_POST['chang'];
$minde = $_POST['minde'];
$ord = $_POST['ord'];
$besked = $_POST['besked'];
}
/*
* Her er en simpel funktion der spytter en fejlmelding ud.
* Den bruger vi senere, når vi checker, at folk har skrevet noget i formularen.
*/
function gbog_fejl($fejl) {
$generel_tekst = "<p>Vær venlig at gå tilbage og ret til.</p>";
$fejlmelding = "<ul>";
for($i=0;$i<count($fejl);$i++) {
$fejlmelding .= "<li>". $fejl[$i];
}
$fejlmelding .= "</ul>";
echo top("Fejl") . "Fejl:" . $fejlmelding . $generel_tekst . bund();
exit;
}
/*
* Denne funktion skriver i gæstebogen - altså i databasen.
* Bemærk, at vi ikke bruger PHP til at indsætte tiden, men
* bruger MySQLs indbyggede funktion now().
*/
function skriv_i_gbog($profilnavn, $navn, $alder, $height, $weight, $email, $shirtno, $position, $idol, $klub, $favchang, $status, $unger, $personlig, $chang, $minde, $ord, $besked) {
$ip = getenv('REMOTE_ADDR');
$sql = "UPDATE andreas SET ip = '$ip', tid = now(), profilnavn = '$profilnavn', navn = '$navn', alder = '$alder', height = '$height', weight = '$weight, email = '$email', shirtno = '$shirtno', position = '$position', idol = '$idol', klub = '$klub', favchang = '$favchang', status = '$status', unger = '$unger', personlig = '$personlig' = '$chang', chang = '$chang', minde = '$minde', ord = '$ord', besked = '$besked')
aabn_forbindelse_og_vaelgdb();
sql_spoerg($sql);
luk_forbindelse();
}
/*
* Vi laver lidt simpelt fejlcheckeri og ser, om der overhovedet
* er skrevet noget. Hvis ikke, bruger vi fejlfunktionen til at brokke os.
* Fejlfunktionen slutter med "exit", der sørger for, at PHP stopper.
*/
if(!ereg("[A-z0-9]+", $profilnavn)) {
$fejl[] = "Du har ikke skrevet et profilnavn";
}
if(count($fejl) > 0) {
gbog_fejl($fejl);
}
/*
* Hvis vi er nået hertil, så står der i det mindste et eller andet i felterne og vi
* knalder det i databasen med funktionen skriv_i_gbog().
* Vi escaper alle fyfy-tegn med addslashes(). Når vi senere præsenterer indholdet
* af gBogen bruger vi stripslashes() til at "afkode".
*
* Alt dette besvær er til for at folk ikke skal snige ondsindede SQL-kommandoer
* ind i deres indlæg. Nyere versioner af PHP gør alt dette automatisk,
* men vi kan godt li' at være på den sikre side.
*/
skriv_i_gbog(addslashes($profilnavn),addslashes($navn),addslashes($alder),addslashes($height),addslashes($weight),addslashes($email),addslashes($shirtno),addslashes($position),addslashes($idol),addslashes($klub),addslashes($favchang),addslashes($status),addslashes($unger),addslashes($personlig),addslashes($chang),addslashes($minde),addslashes($ord),addslashes($besked));
/*
* Så er skidtet banket i databasen og vi sender folk videre til selve gBogen
* hvor de kan se deres eget indlæg.
*/
header("Location: andreas.php");
/*
* Skal der sendes email til administratoren?
*
* Bemærk, at vi godt kan gøre dette selv om folk er sendt videre til gBogen.
* Der er ingen grund til at gæsterne skal vente på, at der bliver sendt
* post - derfor kommer det først allersidst.
*/
if($email_p == "t") {
mail($admin_email, "Der er skrevet i en profil!", $navn);
}
?>
filen som sender info til gem.php
rediger.php
<?php
require("gbog-ting/design-funktioner.php");
require("gbog-ting/mysql-funktioner.php");
require("gbog-ting/indstillinger.php");
if(is_array($HTTP_GET_VARS)) {
$start_nr = $HTTP_GET_VARS['start_nr'];
} elseif (is_array($_GET)) {
$start_nr = $_GET['start_nr'];
}
if(!$start_nr || $start_nr < 0) {
$start_nr = 0;
}
$sql = "select id, profilnavn, navn, alder, email, shirtno, position, idol, klub, status, unger, personlig, chang, minde, ord, besked, date_format(tid, '%e/%c %Y, %H:%i') as tiden from andreas order by tid desc limit $start_nr, $antal_ad_gangen";
aabn_forbindelse_og_vaelgdb();
$resultat = sql_spoerg_og_faa_svar($sql);
luk_forbindelse();
for($i=0;$i<count($resultat);$i++) {
extract($resultat[$i]);
?>
<form action="gem.php" method="post">
<div align="center">
<table border="1" width="600" id="table3" style="border-width: 0px" cellspacing="0" cellpadding="0">
<tr>
<td style="border-style: none; border-width: medium" bgcolor="#669999">
<blockquote>
<blockquote>
<p><font size="6"><b>Profilnavn:</b></font><b><font size="6"> </font>
<font size="2">
<input type="text" name="profilnavn" value="<?php echo $profilnavn ?>" size="30" maxsize="100"></font></b></p>
<p><font size="2"><b>3 ord om dig selv: </b></font>
<input type="text" name="ord" value="<?php echo $ord ?>" size="46" maxsize="100"></p>
</blockquote>
</blockquote>
</td>
</tr>
<tr>
<td style="border-style: none; border-width: medium">
</td>
</tr>
<tr>
<td style="border-style: none; border-width: medium">
<table border="1" width="100%" id="table4" style="border-width: 0px" bgcolor="#669999" height="782">
<tr>
<td width="30%" style="border-style: none; border-width: medium" colspan="5" rowspan="9" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" width="15%" align="right">
<p align="right"><b><font size="2">navn</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="navn" value="<?php echo $navn ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right">
<b><font size="2">trøjenummer</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="shirtno" value="<?php echo $shirtno ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right">
<b><font size="2">favorit Position</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="position" value="<?php echo $position ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right">
<b><font size="2">favorit Spiller(e)</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="idol" value="<?php echo $idol ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right">
<b><font size="2">favorit Klub(ber)</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="klub" value="<?php echo $klub ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right" bgcolor="#669999">
<b>favorit changspiller</b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="favchang" value="<?php echo $favchang ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right" bgcolor="#669999">
</td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#669999"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#669999" colspan="2"> </td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right">
<b><font size="2">ægteskabsstatus</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="status" value="<?php echo $status ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="15%" align="right" bgcolor="#669999">
<b><font size="2">børn</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" colspan="2"><b>
<font size="2">
<input type="text" name="unger" value="<?php echo $unger ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td width="5%" style="border-style: none; border-width: medium" align="right" bgcolor="#669999"> </td>
<td width="1%" style="border-style: none; border-width: medium" align="right" bgcolor="#669999"> </td>
<td width="7%" style="border-style: none; border-width: medium" align="right" bgcolor="#669999"> </td>
<td style="border-style: none; border-width: medium" width="2%" align="right" bgcolor="#669999"> </td>
<td style="border-style: none; border-width: medium" width="20%" align="right" bgcolor="#669999"> </td>
<td style="border-style: none; border-width: medium" width="15%" align="right" bgcolor="#669999"> </td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#669999"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#669999" colspan="2"> </td>
</tr>
<tr>
<td width="5%" style="border-style: none; border-width: medium" bgcolor="#669999" height="21">
<b><font size="2">alder</font></b></td>
<td width="1%" style="border-style: none; border-width: medium" bgcolor="#99CCCC" height="21"> </td>
<td width="7%" style="border-style: none; border-width: medium" bgcolor="#99CCCC" height="21"><b>
<font size="2">
<input type="text" name="alder" value="<?php echo $alder ?>" size="4" maxsize="100"></font></b></td>
<td style="border-style: none; border-width: medium" width="2%" align="right" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" width="36%" align="right" bgcolor="#669999" height="21" colspan="2">
<b><font size="2">personlige Mål i SuperChang</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC" height="21"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" height="42" colspan="2" rowspan="2"><b>
<font size="2">
<input type="text" name="personlig" value="<?php echo $personlig ?>" size="36" maxsize="100"></font></b></td>
</tr>
<tr>
<td width="5%" style="border-style: none; border-width: medium" bgcolor="#669999" height="21">
<b><font size="2">højde</font></b></td>
<td width="1%" style="border-style: none; border-width: medium" bgcolor="#99CCCC" height="21"> </td>
<td width="7%" style="border-style: none; border-width: medium" bgcolor="#99CCCC" height="21"><b>
<font size="2">
<input type="text" name="height" value="<?php echo $height ?>" size="4" maxsize="100"></font></b></td>
<td style="border-style: none; border-width: medium" width="2%" align="right" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" width="36%" align="right" bgcolor="#669999" height="21" colspan="2">
</td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC" height="21"> </td>
</tr>
<tr>
<td width="5%" style="border-style: none; border-width: medium" bgcolor="#669999" height="21">
<b><font size="2">vægt</font></b></td>
<td width="1%" style="border-style: none; border-width: medium" bgcolor="#99CCCC" height="21"> </td>
<td width="7%" style="border-style: none; border-width: medium" bgcolor="#99CCCC" height="21"><b>
<font size="2">
<input type="text" name="weight" value="<?php echo $weight ?>" size="4" maxsize="100"></font></b></td>
<td style="border-style: none; border-width: medium" width="2%" align="right" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" width="36%" align="right" bgcolor="#669999" height="21" colspan="2">
<b><font size="2">bedste minde fra SuperChang</font></b></td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#99CCCC" height="21"> </td>
<td style="border-style: none; border-width: medium" align="left" width="42%" bgcolor="#99CCCC" height="42" colspan="2" rowspan="2">
<input type="text" name="minde" value="<?php echo $minde ?>" size="36" maxsize="100"></td>
</tr>
<tr>
<td width="5%" style="border-style: none; border-width: medium" bgcolor="#669999" height="21"> </td>
<td width="1%" style="border-style: none; border-width: medium" bgcolor="#669999" height="21"> </td>
<td width="7%" style="border-style: none; border-width: medium" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" width="2%" align="right" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" width="20%" align="right" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" width="15%" align="right" bgcolor="#669999" height="21"> </td>
<td style="border-style: none; border-width: medium" align="left" width="1%" bgcolor="#669999" height="21"> </td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" align="right" colspan="9">
<p align="center"><b><font size="2"> <?php echo $navn; ?>'s Ord</font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" align="right" colspan="9" bgcolor="#FFFFFF">
<b><font size="2">
<textarea cols="71" rows="10" name="besked"></textarea></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" colspan="9">
<p align="center"><font size="2"><b>emailadresse: </b>
</font>
<input type="text" name="email" value="<?php echo $email ?>" size="31" maxsize="100"></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" colspan="9">
</td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" colspan="8">
<p align="center"><b><font color="#FF0000">Du kan godt ændre
infoen uden at uploade et nyt profilbillede</font></b></td>
<td style="border-style: none; border-width: medium" width="21%">
<p align="center">
<input type="submit" value="GEM" name="gem"></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" colspan="9">
<table border="1" width="100%" id="table5" style="border-width: 0px" bgcolor="#669999">
<tr>
<td style="border-style: none; border-width: medium" bgcolor="#FFFFFF">
<p align="center"><b><font color="#FF0000"><font size="4">
Billedet skal være en .jpg fil.</font> </font>
<font color="#0000FF" size="2"><a href="andreas/help.php">
hjælp</a></font></b></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium">
<iframe name="I1" src="andreas/upload.php" width="588" height="83" scrolling="no" align="center" border="0" frameborder="0">
Webbrowseren understøtter ikke indbyggede rammer eller er aktuelt konfigureret til ikke at vise indbyggede rammer.
</iframe></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
}
echo bund();
?>
