Beste CP'ers,
Ik ben bezig met een community script maar nu loop ik tegen een probleem aan wat ik echt niet zelf zie.
Dit script zou gegevens moeten opslaan in de database:
PHP
<?
include("global.php");
include("header.php");
if(ingelogd() == TRUE){
if(isset($_GET['actie']) AND $_GET['actie'] == "controleren"){
if(!empty($_POST['avatar'])){
if(remote_file_exists($_POST['avatar'])){
list($width, $height, $type, $attr) = getimagesize($_POST['avatar']);
if($width > 100 OR $height > 100){
begintabel("Foutmelding");
echo "De door u gekozen avatar voldoet niet aan onze eisen: maximaal 100x100!<br>
Uw avatar is ".$width."x".$height."!";
eindetabel();
} else {
@mysql_query("UPDATE leden SET
woonplaats='".addslashes($_POST['woonplaats'])."',
homepage='".addslashes($_POST['homepage'])."',
land='".addslashes($_POST['land'])."',
designen='".addslashes($_POST['designen'])."',
php='".addslashes($_POST['php'])."',
signature='".addslashes($_POST['signature'])."',
jquery='".addslashes($_POST['jquery'])."',
htmlcss='".addslashes($_POST['htmlcss'])."',
SEO='".addslashes($_POST['SEO'])."',
avatar='".$_POST['avatar']."'
WHERE id='".$_COOKIE['id']."'") or die(mysql_error());
begintabel("Profiel bijgewerkt");
echo "Uw profiel is succesvol bijgewerkt!";
eindetabel();
}
} else {
begintabel("Foutmelding");
echo "De door u gekozen avatar bestaat niet!";
eindetabel();
}
} else {
@mysql_query("UPDATE leden SET
woonplaats='".addslashes($_POST['woonplaats'])."',
homepage='".addslashes($_POST['homepage'])."',
land='".addslashes($_POST['land'])."',
designen='".addslashes($_POST['designen'])."',
php='".addslashes($_POST['php'])."',
signature='".addslashes($_POST['signature'])."',
jquery='".addslashes($_POST['jquery'])."',
htmlcss='".addslashes($_POST['htmlcss'])."',
SEO='".addslashes($_POST['SEO'])."',
avatar='".$_POST['avatar']."'
WHERE id='".$_COOKIE['id']."'") or die(mysql_error());
begintabel("Profiel bijgewerkt");
echo "Uw profiel is succesvol bijgewerkt!";
eindetabel();
}
} else {
echo "<form name='pw' action='".$_SERVER['PHP_SELF']."?actie=controleren' method='POST'>";
begintabel("Persoonlijke gegevens");
$query = @mysql_query("SELECT * FROM leden WHERE id='".$_COOKIE['id']."'");
$row = @mysql_fetch_assoc($query);
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='50%' height='24'>Woonplaats</td>
<td width='50%' height='24'><input type='text' name='woonplaats' value='".stripslashes($row['woonplaats'])."'></td>
</tr>
<tr>
<td width='50%' height='24'>Land</td>
<td width='50%' height='24'>";
if($row['land'] == "Nederland"){
echo "<select size='1' name='land'>
<option value='Nederland' selected>Nederland</option>
<option value='België'>Beglië</option>
<option value='Overig'>Overig</option>
</select>";
} elseif($row['land'] == "Beglië"){
echo "<select size='1' name='land'>
<option value='Nederland'>Nederland</option>
<option value='België' selected>Beglië</option>
<option value='Overig'>Overig</option>
</select>";
} else {
echo "<select size='1' name='land'>
<option value='Nederland'>Nederland</option>
<option value='België'>Beglië</option>
<option value='Overig' selected>Overig</option>
</select>";
}
echo "</td>
</tr>
<tr>
<td width='50%' height='24'>Website(s)</td>
<td width='50%' height='24'><input type='text' name='homepage' value='".stripslashes($row['homepage'])."'></td>
</tr>
</table>";
eindetabel();
echo "<br>";
begintabel("Signature");
echo icon("pw", "signature");
echo "<textarea style='width: 100%;' name='signature' rows='6'>".htmlspecialchars(stripslashes($row['signature']))."</textarea>";
eindetabel();
echo "<br>";
begintabel("Avatar");
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='50%' height='24'>Huidige avatar<br> </td>
<td width='50%' height='24' valign='top'>";
if(!empty($row['avatar'])){
echo "<img src='".$row['avatar']."'>";
} else {
echo "<i>Geen avatar ingesteld</i>";
}
echo "<br> </td>
</tr>
<tr>
<td width='50%' height='24'>Avatar URL</td>
<td width='50%' height='24'><input type='text' name='avatar' value='".stripslashes($row['avatar'])."'></td>
</tr>
</table>";
eindetabel();
echo "<br>";
begintabel("Vaardigheden");
$designen[1] = "";
$designen[2] = "";
$designen[3] = "";
$designen[4] = "";
$designen[5] = "";
$designen[$row['designen']] = " selected";
$php[1] = "";
$php[2] = "";
$php[3] = "";
$php[4] = "";
$php[5] = "";
$php[$row['php']] = " selected";
$htmlcss[1] = "";
$htmlcss[2] = "";
$htmlcss[3] = "";
$htmlcss[4] = "";
$htmlcss[5] = "";
$htmlcss[$row['htmlcss']] = " selected";
$jquery[1] = "";
$jquery[2] = "";
$jquery[3] = "";
$jquery[4] = "";
$jquery[5] = "";
$jquery[$row['jquery']] = " selected";
$SEO[1] = "";
$SEO[2] = "";
$SEO[3] = "";
$SEO[4] = "";
$SEO[5] = "";
$SEO[$row['SEO']] = " selected";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='50%' height='24'>Webdesign</td>
<td width='50%' height='24'><select size='1' name='designen'>
<option value='1'".$designen[1].">1</option>
<option value='2'".$designen[2].">2</option>
<option value='3'".$designen[3].">3</option>
<option value='4'".$designen[4].">4</option>
<option value='5'".$designen[5].">5</option>
</select></td>
</tr>
<tr>
<td width='50%' height='24'>Programmeren</td>
<td width='50%' height='24'><select size='1' name='php'>
<option value='1'".$php[1].">1</option>
<option value='2'".$php[2].">2</option>
<option value='3'".$php[3].">3</option>
<option value='4'".$php[4].">4</option>
<option value='5'".$php[5].">5</option>
</select></td>
</tr>
<tr>
<td width='50%' height='24'>(X)HTML/CSS</td>
<td width='50%' height='24'><select size='1' name='htmlcss'>
<option value='1'".$htmlcss[1].">1</option>
<option value='2'".$htmlcss[2].">2</option>
<option value='3'".$htmlcss[3].">3</option>
<option value='4'".$htmlcss[4].">4</option>
<option value='5'".$htmlcss[5].">5</option>
</select></td>
</tr>
<tr>
<td width='50%' height='24'>jQuery</td>
<td width='50%' height='24'><select size='1' name='jquery'>
<option value='1'".$jquery[1].">1</option>
<option value='2'".$jquery[2].">2</option>
<option value='3'".$jquery[3].">3</option>
<option value='4'".$jquery[4].">4</option>
<option value='5'".$jquery[5].">5</option>
</select></td>
</tr>
<tr>
<td width='50%' height='24'>SEO</td>
<td width='50%' height='24'><select size='1' name='SEO'>
<option value='1'".$SEO[1].">1</option>
<option value='2'".$SEO[2].">2</option>
<option value='3'".$SEO[3].">3</option>
<option value='4'".$SEO[4].">4</option>
<option value='5'".$SEO[5].">5</option>
</select></td>
</tr>
</table>";
eindetabel();
echo "<br>";
echo "<br>";
begintabel("Bevestigen");
echo "<input type='submit' value='Profiel Wijzigen'>";
eindetabel();
echo "</form>";
}
} else {
begintabel("Foutmelding");
echo "U dient ingelogd te zijn om deze pagina te kunnen bekijken!";
eindetabel();
}
include("footer.php");
?>
Toon Meer
Nou doet hij dit behalve met 'Vaardigheden' -> SEO, jQuery en (X)Html/CSS.
Iemand enig idee waar het probleem zit?
Met vriendelijke groet
Nils Henderik