Hi,
So I wanted to add a little CMS to the site and posted about it already, but it turned it this is a more suitable place for this subject on this forum. So here goes again.
In principle I got a solution. But there's still one little issue, maybe someone could help me out? This is what I do, e.g., for index.php:
1. index.php shows a link to editindex.php if the user is an admin
2. editindex.php has a textarea including HTMLarea 3 (really nice bar with text options)
3. editindex.php is a form and links to updateindex.php.
This all works very well. Accept for one thing: the update doesn't take place correclty, there's no error, but the text you write in the textarea gets lost and the database gets filled with... nothing!
Here's the code of the updateindex.php file:
Do you know what is going wrong?
And an additional question: should I perhaps make a function in process.php? As this update-process is going to be used for many other pages. How would I go about that? Are there any other things in the other login-script-pages that I should change (form.php, session.php)?
Thank you!
Regards,
Sander
So I wanted to add a little CMS to the site and posted about it already, but it turned it this is a more suitable place for this subject on this forum. So here goes again.
In principle I got a solution. But there's still one little issue, maybe someone could help me out? This is what I do, e.g., for index.php:
1. index.php shows a link to editindex.php if the user is an admin
2. editindex.php has a textarea including HTMLarea 3 (really nice bar with text options)
3. editindex.php is a form and links to updateindex.php.
This all works very well. Accept for one thing: the update doesn't take place correclty, there's no error, but the text you write in the textarea gets lost and the database gets filled with... nothing!
Here's the code of the updateindex.php file:
- Code:
<?php
include("_includes/session.php");
session_start();
$sql = "UPDATE content SET text='$text' WHERE con_id='1' AND fk_con_group_id='1' ";
$res = mysql_query($sql);
header("Location: index.php"); exit;
?>
Do you know what is going wrong?
And an additional question: should I perhaps make a function in process.php? As this update-process is going to be used for many other pages. How would I go about that? Are there any other things in the other login-script-pages that I should change (form.php, session.php)?
Thank you!
Regards,
Sander