Ik weet wel hoe je tekst in een database kan toevoegen via insert into enzo.
Maar ik een database leden, waar leden van me site staan. En ik heb een script gemaakt waar ze kunnen hun biografie ect kunnen toevoegen.
Dat kunnen ze alleen als ze ingelogt zijn.
Ik neem en voorbeeld : piet logt in met ze naam piet, en gaat naar add MIJN profiel.
Dan ziet hij een groot tabel waar hij zijn bio/ tekst kan intikken. Als hij dan op toevoegen klikt moet het in database komen, bij zijn naam PIET, en dan in mijnprofiel.
Als ik naar me database ga en edit doe, dan kan ik wel typen wat ik wil en het komt in mijnprofiel!
Afbeelding niet beschikbaarDe bron kon niet worden geladen (img507.imageshack.us).Bron openen ↗
en dit is mijn script:
Kan iemand me aub helpen
?
Maar ik een database leden, waar leden van me site staan. En ik heb een script gemaakt waar ze kunnen hun biografie ect kunnen toevoegen.
Dat kunnen ze alleen als ze ingelogt zijn.
Ik neem en voorbeeld : piet logt in met ze naam piet, en gaat naar add MIJN profiel.
Dan ziet hij een groot tabel waar hij zijn bio/ tekst kan intikken. Als hij dan op toevoegen klikt moet het in database komen, bij zijn naam PIET, en dan in mijnprofiel.
Als ik naar me database ga en edit doe, dan kan ik wel typen wat ik wil en het komt in mijnprofiel!
Afbeelding niet beschikbaarDe bron kon niet worden geladen (img507.imageshack.us).Bron openen ↗en dit is mijn script:
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"inc/inc.config.php"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id,naam FROM leden WHERE naam="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]num_rows[COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])){
}[/COLOR]
[COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"inc/inc.header.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ingelogd[COLOR= #007700]){[/COLOR][URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent niet ingelogt <a href="/login.php">Kik hier</a> om naar de inlog pagina te gaan!<br /><br />[/COLOR][COLOR= #007700];}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mijnprofiel[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je hebt niks ingevult bij Mijn Profiel <br />
<a href="javascript:history.back(1)">Klik hier om terug te gaan</a>.<br />"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mijnprofiel[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mijnprofiel[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
INSERT INTO
leden
(
id,
mijnprofiel,
naam
)
VALUES(
,
"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mijnprofiel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
NOW()
)"[/COLOR]
[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Mijn Profiel is Succesvol toegevoegd.<br /><a href="/profiel/"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"naam"[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]".html">Klik hier om naar jou profiel te gaan.</a><br />"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<font size=4>Mijn profiel adden!</font>
<form method="post" action="addprofiel.php">
Bericht, bio, of je boomr player!:<br />
<textarea name="nieuws" cols="40" rows="6"></textarea>
<br />
<input type="submit" name="submit" value="Toevoegen" />
</form>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"inc/inc.footer.php"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]();[/COLOR]
?> Kan iemand me aub helpen
?
wat is de fout