News Display Dilemma

They have: 38 posts

Joined: Feb 2003

Hi,

For the current site I"m making I have a spot on the right hand side of the page for news to display. I was originally going to use CuteNews which is php based and I would just use PHP includes to display the news.

But...

There is also a login box which eventually will use ASP. SO I thought that using PHP and ASP on the same page would cause problems. I am not sure whether the page can have the extension .php and have the login work in asp. The asp thing is not changable thats what is going in there so I have to find a way to display and change the news on everypage.

I would appreciate any help in finding something to update the news without having to open every HTML file and changing it.

Thanks in Advance

Busy's picture

He has: 6,151 posts

Joined: May 2001

PHP can use the ASP tags

<?php

?>
but the thing is your server has to allow PHP and ASP, most are one or the other (with exceptions of course).

Are you using PHP or ASP for anything else?
if you just use PHP, you can keep your .html page extensions

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

I've never been in this situation before but heres what I was thinking:

If your server has both ASP and PHP then you should be able to have PHP scripts run in .asp files. You can do a few things for that to work right?

I suggested that because some people have PHP run under .html files...

They have: 38 posts

Joined: Feb 2003

Busy,

What exceptions are there.

For the login, do I even need an .asp file extension for ASP to work inside of the page?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You can include php files in asp pages, if they are parsed separately and then included. You can't just put all different types of scripting in the same file and call it good.

The folks who have php executed in .html files are tricking the server into thinking that .html files are really .php files, these files ARE php files, they just have a fake extension.

He has: 296 posts

Joined: May 2002

How is it a "fake" extension? You can set PHP to execute with any extention, make up your own if you want.

druagord's picture

He has: 335 posts

Joined: May 2003

yes but i dont think the server can send the same page for asp parsiing and php parsing so suzanne solution look's like the best one to me

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

The are "fake" in that the extension is meaningless. This is a terrific advantage for keeping urls constant despite changing technologies, but it can lead to a heavy burden on the server as pages that are normally served static now have to be parsed. Unless EVERY SINGLE PAGE is going to be parsed, it's not an advantage to use a fake/false/trick extension that has a real purpose, such as .html and .htm.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

It was a while ago, and my memory may have warped on me. But after reading a document of some kind, I had the impression that Apache 2 could send a single file through multiple file handlers. Of course, I would expect the second file handler to begin with the output of the first file handler.

Why would you want this? Well, you could have .php files go through the SSI file handler before being passed to the php parser. Then you could have SSI tags include files in your php scripts (as ASP pages do).

But.. I don't see this being a solution here.

Generally speaking, I think it's considered good practice to keep technologies (such as ASP and PHP) from intertwining too closely.

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 461 posts

Joined: Jul 2003

Mark/Suzanne: what if they use an include? will that file be parsed by its parser and the result included? if so would that be safer than multiple parsers?

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

As far as I know, ASP's file include system is simply SSI, which would just insert the php file's source and not parse it. I don't really see a way to do it in PHP either.

I would strongly suggest trying to keep your site on one technology. Be it ASP or PHP.

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.