This is the first time I have looked at a PHP scripting (although I have done some ASP.NET) and I am looking for help with the following.

Can PHP be used to update a HTML page - and if so how or where should I look?

This is for a site with a news section and the user would like a page to be able to update the news secion (add/remove items).

This used to be done in ASP.NET, but they have moved to a hosting company that does not provide ASP.NET.

Many thanks.

Sorry for not being clear.

They have a news page on the website and they are l0ooking for a page only they can access where they can update the news from.

Does this help?

Is the news coming from the database ? Do you want to update the news in the database using a frontend ? I am sorry, I still can't understand it. Could you show us the code so that we could understand better ?

Please see the code below. The news is not currently coming from a database (I wish it was).

</table></td>
</tr>
<tr>
<td height="51"><img src="images/t-news.gif" width="517" height="51"></td>
</tr>
<tr>
<td height="328" align="center" background="images/bkg-home.gif">
<table width="460" border="0" cellpadding="0" cellspacing="5">
<tr>
<td> <div id="Layer1" style="position:relative; width:480px; height:300px; z-index:1; left: 0; top: 0; overflow: auto;" class="scrolling_content">
<table width="420" border="0" cellspacing="15" cellpadding="0">


<tr>
<td align="left" valign="top" class="txt_j"><em>13/12/2007</em> - <strong><font color="#F26121">Christmas</font></strong></td>
</tr>
<tr>
<td align="left" valign="top" class="txt_j">We would like to wish all our clients and friends a Happy Christmas and a Healthy and prosperous New Year. <br>For those of you yet to contact us for 2008, time is running out.</td>
</tr>
<tr>
<td align="left" valign="top" class="bkg_lines"><img src="images/dotted_line.gif"></td>
</tr>


<tr>
<td align="left" valign="top" class="txt_j"><em>13/12/2007</em> - <strong><font color="#F26121">2008 Coming up FAST............</font></strong></td>
</tr>
<tr>
<td align="left" valign="top" class="txt_j">It is not long before 2008 will be here <br><br>We are now planning for 2009<br><br>Do not forget to contact us on or new telephone number<br><br>The number is: </td>
</tr>
<tr>
<td align="left" valign="top" class="bkg_lines"><img src="images/dotted_line.gif"></td>
</tr>


</table>
</div></td>
</tr>
</table>

okay! now thats a basic html with table and td tags. You forgot to mention "what" you want to update.

Sorry once agin, not doing very well am I. Thank you for your help.

It is the text within the table, e.g. remove the entries about Chirstmas and and something about Easter. Or just to add something about Easter now and remove other items later.

Does this help?

Okay.. The simplest way is, put whatever you want in a variable and print that variable whereever you want. For example,

<?php
$text1="This is some random text ! blah blah blah..<br />I just added a break.";
$text2="One more test.. ";
?>
<html>
<body>
<table>
<tr>
<td>
<?php echo $text1; ?>
</td>
</tr>
<tr>
<td>
<?php echo $text2; ?>
</td>
</tr>
</table>
</body>
</html>

This is just an example. You can do it this way.
Hope that helps.
Cheers,
Naveen

Comments
Great Help
This question has already been answered. Start a new discussion instead.