paddymull Posted January 24, 2009 Share Posted January 24, 2009 Hi all, Right just to let you all know am new to php, what I want to do let my customers change one of there php page's within an admin area. for example lets say they have a page with lets say welcome text on it, i wont hem to be able to go to an admin area and update it. so there would be a text area with the welcome text already in it, and if they change it and click save then this will update on there php page and will be able to be seen if the url is typed in. I suppose its a bit of content management i want them to be able to do. what i have managed to do is create a php file that has a text area in it and i can get it to send the text i put into it to another php page, but this isn't saved on the page as if you cross it off and go back on it the info i added is no longer there. here's an example of what i have done http://onlineframedpictures.co.uk/example/example.php it then updates this page http://onlineframedpictures.co.uk/example/example1.php but like i said it doesn't save, how can i get it to save?? do i need to use my sql database?? if so how do i do this??? below is the code used in the example.php file <form name="example1" action="example1.php" method="POST" target="_blank"> <textarea cols=68 rows=27 name="message"></textarea> <input type="submit" value=" save "> and here is the code used in example1.php <?php /* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */ $message = $HTTP_POST_VARS['message']; //magic quotes fix $message= (get_magic_quotes_gpc())?stripslashes($message):$message; ?> <P><FONT face=Arial color=#333333 size=2><?php echo $message ?></FONT></P> how can i do this so it changes the page permanently thanks in advance Patrick Link to comment https://forums.phpfreaks.com/topic/142213-how-to-update-a-php-page-using-a-form/ Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 You would need to use a database or use flat files if you want to use database (which is a better option) the first thing you would need is a database then to know how to connect to it I have some basic tutorials the first one starts with connecting to a database have a look may be useful http://www.newmedia.lincoln.ac.uk/dcarr/tutorials/php/p-6 Link to comment https://forums.phpfreaks.com/topic/142213-how-to-update-a-php-page-using-a-form/#findComment-745025 Share on other sites More sharing options...
paddymull Posted January 24, 2009 Author Share Posted January 24, 2009 I will have a look at that but think i will be lost lol, like i said am new to php and never done out like this before, i will look at how to do it using database, if anyone could explain how to do this it would help thanks from patrick Link to comment https://forums.phpfreaks.com/topic/142213-how-to-update-a-php-page-using-a-form/#findComment-745032 Share on other sites More sharing options...
xtopolis Posted January 24, 2009 Share Posted January 24, 2009 click nuttycoder's link and / or check out this one: http://www.tizag.com/mysqlTutorial/ this isn't going to come instantly, but it will pay off 10 fold if you take the time to learn it. Link to comment https://forums.phpfreaks.com/topic/142213-how-to-update-a-php-page-using-a-form/#findComment-745048 Share on other sites More sharing options...
paddymull Posted January 24, 2009 Author Share Posted January 24, 2009 thanks well i need to do it so will have a good look over it all thanks again Link to comment https://forums.phpfreaks.com/topic/142213-how-to-update-a-php-page-using-a-form/#findComment-745052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.