Hey,
I'm making a website for my band. What I'm needing is to be able to change the body text (not the whole page), I have coded a script that can make a post for our blog. I was wondering how (if i put all the body text for the other pages in to a database) I could take the text out of the database and show it in a text box, that i can edit then press submit and it would change the text in the database.
Then when you view the page, the changes would be made. This would make it easier so i don't have to change the php page, and then upload the file. I can do everything from the site.
OH YES!! i forgot to tell you that i DO have a login script that i'm using so that no one but THE BAND can change anything.
THANKS IN ADVANCE
PS: hopefully you understand. if you don't, ask me questions i'm always open.
Changing text from database
Moderator: General Moderators
Re: Changing text from database
i think you are talking about having an admin page. The admin page will allow you to edit certain parts of your web site. I will do something really simple,
like having a key-value table. Then your admin will allow you to edit those keys. Then in your page you will show the values.
this is non working code:
It is very simple but you need to know how to read and write to a database. I suggest looking at some tutorials.
like having a key-value table. Then your admin will allow you to edit those keys. Then in your page you will show the values.
this is non working code:
Code: Select all
<?
$news = get_from_sql( select VALUE FROM TABLE WHERE KEY='NEWS');
?>
The news are
<?= $news?>
Re: Changing text from database
yacahuma wrote:i think you are talking about having an admin page. The admin page will allow you to edit certain parts of your web site. I will do something really simple,
like having a key-value table. Then your admin will allow you to edit those keys. Then in your page you will show the values.
this is non working code:It is very simple but you need to know how to read and write to a database. I suggest looking at some tutorials.Code: Select all
<? $news = get_from_sql( select VALUE FROM TABLE WHERE KEY='NEWS'); ?> The news are <?= $news?>
OH!!! i get it, thanks. Yeah i'll look at some tutorials.