Submit form to update .php file

  • honeyham
  • Novice
  • Novice
  • honeyham
  • Posts: 16

Post 3+ Months Ago

Hello!

I am a newbie with web programming, so please bear with me!

I was very pleased with myself for being able to learn how to use the php 'include' command to easily update news updates within a single cell/panel that exists on multiple pages within a site. I used the code:

<?php include("news.php"); ?>

And so news.php contains text and styles from an external styling sheet, such as:

<p><span class="jan">23</span><span class="lefttitles"> Lorem
ipsum dolor</span></p>
<p class="lefttext">Lorem ipsum dolor sit amet, consectetu er adipiscing
elit, sed diam nonummy n ibh euismod tincidunt ut laoreet dolore&nbsp; magna
aliquam erat volutpat. Utll wisi e nim ad minim veniam, quis nostrud
exe rci tation.</p>

Right now, the way it is set up, the person adding news to the news.php file would have to go through a series of steps in order to update each time.

Instead, he is requesting a sort of admin page with a form that is password protected that he may enter information and simply click 'submit' and be done. Does anyone have any idea how I can do this and also make sure that the class/styling info is included in the data submitted? And the reason I did not try using Drupal or Joomla is because the site has already been created using Dreamweaver.

Additionally, when content overflows, I have it set up to have a scroll bar. However, he wants the updated news to push the old news downward, until it is full, and then have a "SHOW MORE NEWS" button appear at the bottom. Any ideas on how to do this? I suppose this may be more appropriate for the website design forum.

Any help is MUCH appreciated!

Thanks in advance.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

If you want to update News.php like you would a CMS, then you should consider building a front end interface that allows someone to write articles that are saved to the database. News.php would then be altered to do a Select query to pull the articles and display them dynamically.

Now, given that you're just getting familiar with include, this probably sounds daunting. I recommend you Google PHP/MySQL tutorials (and there will be MANY) and start there. Whether you choose to implement this now or not, this is a common schema that you should take the time to learn up front.
  • honeyham
  • Novice
  • Novice
  • honeyham
  • Posts: 16

Post 3+ Months Ago

UPSGuy, thanks very much for the tip!
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8416
  • Loc: USA

Post 3+ Months Ago

We've also got some PHP tutorials here on OZZU PHP tutorials section.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.