PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// We willen de ID van de pagina kennen.
if (isset($_GET['pid'])) {
$pageid = preg_replace('/[^a-zA-Z0-9\_]/', '', $_GET['pid']); // delete chars NOT in that set
} else {
$pageid = 'page1';
}
// We hebben de benodigde files nodig.
include('../../functions.php');
include('../../functions_willem.php');
// Naam user
$localuser = getcurrentuser(realpath('.'));
// We openen de verbinding met de database.
$db = opendatabase();
opendatabase();
// Update als nodig is.
if (isset($_POST['content_a'])) {
$content_a = $_POST['content_a'];
$sqlquery =("UPDATE SET tblContent (content_a) VALUES ('$content_a') WHERE page='$pageid' AND username='$localuser' ");
$results = mysql_query($sqlquery);
}
else { };
Next time, please tell us exactly what is happening, simply don't say why isn't this working. Secondly you are checking for $POST['content_a'] -- this should be $_POST['content_a'].
if (isset($_POST['content_a'])) {
$content_a = $_POST['content_a'];
$sqlquery =("UPDATE tblContent SET content_a='$content_a' WHERE page='$pageid' AND username='$localuser' ");
$results = mysql_query($sqlquery) or die(mysql_error());
}
else { };