Inserting PHP code onto a FP2003 page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to publish live news feeds on my site.

I can get the code to show those feeds in PHP.

I have converted the page file name to a .PHP extention.

But I cannot get the actual news to appear on my page.

Do I have to surround my PHP code with some special html code in order to
make it come live?
 
Are you hosted on a server that supports PHP?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Thomas A. Rowe said:
Are you hosted on a server that supports PHP?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================




Yes, I am.
 
Ok, then you need to check with the site that is providing the newsfeed for the required code.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Thomas A. Rowe said:
Ok, then you need to check with the site that is providing the newsfeed for the required code.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================




I have got the required code. My problem is that when I paste it in to Front Page all I see is the code not the news.

Is there some special place where I need to insert the code or some special
way that this code needs to be inserted?
 
Paste the code into Notepad, then copy from Notepad into HTML or Code
view in FrontPage.
 
PHP in an FP web page looks a little like this:

----------------
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Revision History</title>
<meta name="Microsoft Border" content="tb, default">
</head>

<body>

<h2>Recent revisions to an Unofficial FAQ for
<a href="microsoft.public.money</a></h2>

<script language = "php">
/* pick up some handy includes */
require_once "faq_dbconnect_php.inc";
require_once 'faq_semiHTMLformatter_php.inc';

/* Connect to the database server */
$dbcnx = faq_dbServerConnect();

if (! $dbcnx) {
die("<p>Unable to connect to the database server at this
time.</p>\r\n</body>\r\n</html>\r\n");
}

/* Select the test database */
if (! faq_dbSelect()) {
/* Closing connection */
mysql_close($dbcnx);

die("<p>Unable to locate the FAQ database at this
time.</p>\r\n</body>\r\n</html>\r\n");
}

/* Request the text of all the categories */
$resultUpdates = @mysql_query("SELECT DATE_FORMAT(tblupdates.dtmUpdateDate,
'%d %M %Y') AS dateFrmtd, tblupdates.memUpdateStr " .
'FROM tblupdates ' .
'WHERE
(tblupdates.dtmUpdateDate>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) ' .
'ORDER BY tblupdates.dtmUpdateDate DESC ' .
'LIMIT 6');

if (! $resultUpdates) {
/* Closing connection */
mysql_close($dbcnx);

die('<p>Error performing query: ' . mysql_error() . ' File: ' . __FILE__ .
' on line: ' . __LINE__ . "</p>\r\n</body>\r\n</html>\r\n");
}


/* Display the text of each update in a paragraph */
while ($row = mysql_fetch_array($resultUpdates)) {
echo wordwrap('<P>' . $row['dateFrmtd'] . ' -- ' .
faq_formatSemiHTMLtoHTML($row['memUpdateStr'], 'faqdb.php?') .
"</p>\r\n\r\n");
}

/* Free resultset */
mysql_free_result($resultUpdates);

/* Closing connection */
mysql_close($dbcnx);

</script>

</body>

</html>
----------------

Test that your PHP is actually working for your pages on the web server with
a test page name phpinfo.php with contents:

----------------
<?php

// Show all information, defaults to INFO_ALL

phpinfo();

?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top