Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Using PHP and ASP in a single source file?

Reply
Thread Tools

Using PHP and ASP in a single source file?

 
 
Dan S
Guest
Posts: n/a
 
      09-30-2003
I'm a software engineer but pretty naive about web programming/scripting.
I'm working with a server running Windows IIS. I have several ASP files and
several PHP
files (not developed by me) that all work fine on the server. There's a
little ASP that's to be put at the top of every page, which of course works
fine for the .ASP pages. Now, if I want
to include this same snippet of ASP code at the top of one of the PHP files,
is that possible?
If so, what would the extension of the "mainly PHP" file be? If the
extension is PHP, the ASP won't be recognized, and vice-versa. That's what
I'm experiencing anyway.

Thanks,

Dan





 
Reply With Quote
 
 
 
 
gorf
Guest
Posts: n/a
 
      09-30-2003
"Dan S" <(E-Mail Removed)> wrote in message
news:blcf7i$ala9j$(E-Mail Removed)-berlin.de...
> I'm a software engineer but pretty naive about web programming/scripting.
> I'm working with a server running Windows IIS. I have several ASP files

and
> several PHP
> files (not developed by me) that all work fine on the server. There's a
> little ASP that's to be put at the top of every page, which of course

works
> fine for the .ASP pages. Now, if I want
> to include this same snippet of ASP code at the top of one of the PHP

files,
> is that possible?
> If so, what would the extension of the "mainly PHP" file be? If the
> extension is PHP, the ASP won't be recognized, and vice-versa. That's what
> I'm experiencing anyway.


The way I understand it, a file's extension tells IIS to use a particular
DLL when working with a file. Unless you have a DLL that reads both ASP and
PHP, I doubt that you can do this. I don't think such a DLL exists either.

My suggestion is to find out which code is easier to convert to the other,
and settle with either PHP or ASP.

--
gorf


 
Reply With Quote
 
 
 
 
Paulus Magnus
Guest
Posts: n/a
 
      10-01-2003

"gorf" <(E-Mail Removed)> wrote in message
news:blcmc6$adg$(E-Mail Removed)...
> "Dan S" <(E-Mail Removed)> wrote in message
> news:blcf7i$ala9j$(E-Mail Removed)-berlin.de...
> > I'm a software engineer but pretty naive about web

programming/scripting.
> > I'm working with a server running Windows IIS. I have several ASP files

> and
> > several PHP
> > files (not developed by me) that all work fine on the server. There's a
> > little ASP that's to be put at the top of every page, which of course

> works
> > fine for the .ASP pages. Now, if I want
> > to include this same snippet of ASP code at the top of one of the PHP

> files,
> > is that possible?
> > If so, what would the extension of the "mainly PHP" file be? If the
> > extension is PHP, the ASP won't be recognized, and vice-versa. That's

what
> > I'm experiencing anyway.

>
> The way I understand it, a file's extension tells IIS to use a particular
> DLL when working with a file. Unless you have a DLL that reads both ASP

and
> PHP, I doubt that you can do this. I don't think such a DLL exists

either.
>
> My suggestion is to find out which code is easier to convert to the other,
> and settle with either PHP or ASP.
>
> --
> gorf
>


You could always use one system to read the other page. For example, if
index.php needed something out of index.asp. You'd have a block of code in
index.php that used file() to read http://yourserver.com/index.asp and then
used a preg_match to hack the resulting bit of HTML from index.asp and then
you could just echo that block wherever you wanted it to appear. If you
placed some HTML comment strings around the bit of ASP you wanted to hack it
would make the whole snipping job a lot easier.

For instance,

<?
$file = file_get_contents ("http://yourserver.com/index.asp");
preg_match ("/<!--{SNIP HERE}-->(.*?)<!--{STOP SNIPPING}-->/s", $file,
$matches);
echo ($matches[1]);
?>

^^ Note: Untested code ^^

It's a bit of a kludge and results in two pages running through your IIS but
it may be a workaround for your duality issue for the moment.

Paul


 
Reply With Quote
 
Manitoba98
Guest
Posts: n/a
 
      11-01-2004
Or you could just use an <iframe>...
"Paulus Magnus" <(E-Mail Removed)> wrote in message
news:bld9tq$qjd$(E-Mail Removed)...
>
> "gorf" <(E-Mail Removed)> wrote in message
> news:blcmc6$adg$(E-Mail Removed)...
> > "Dan S" <(E-Mail Removed)> wrote in message
> > news:blcf7i$ala9j$(E-Mail Removed)-berlin.de...
> > > I'm a software engineer but pretty naive about web

> programming/scripting.
> > > I'm working with a server running Windows IIS. I have several ASP

files
> > and
> > > several PHP
> > > files (not developed by me) that all work fine on the server. There's

a
> > > little ASP that's to be put at the top of every page, which of course

> > works
> > > fine for the .ASP pages. Now, if I want
> > > to include this same snippet of ASP code at the top of one of the PHP

> > files,
> > > is that possible?
> > > If so, what would the extension of the "mainly PHP" file be? If the
> > > extension is PHP, the ASP won't be recognized, and vice-versa. That's

> what
> > > I'm experiencing anyway.

> >
> > The way I understand it, a file's extension tells IIS to use a

particular
> > DLL when working with a file. Unless you have a DLL that reads both ASP

> and
> > PHP, I doubt that you can do this. I don't think such a DLL exists

> either.
> >
> > My suggestion is to find out which code is easier to convert to the

other,
> > and settle with either PHP or ASP.
> >
> > --
> > gorf
> >

>
> You could always use one system to read the other page. For example, if
> index.php needed something out of index.asp. You'd have a block of code in
> index.php that used file() to read http://yourserver.com/index.asp and

then
> used a preg_match to hack the resulting bit of HTML from index.asp and

then
> you could just echo that block wherever you wanted it to appear. If you
> placed some HTML comment strings around the bit of ASP you wanted to hack

it
> would make the whole snipping job a lot easier.
>
> For instance,
>
> <?
> $file = file_get_contents ("http://yourserver.com/index.asp");
> preg_match ("/<!--{SNIP HERE}-->(.*?)<!--{STOP SNIPPING}-->/s", $file,
> $matches);
> echo ($matches[1]);
> ?>
>
> ^^ Note: Untested code ^^
>
> It's a bit of a kludge and results in two pages running through your IIS

but
> it may be a workaround for your duality issue for the moment.
>
> Paul
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FREE SEMINAR on PHP Web Development in Lahore and Rawalpindi, Itcovers PHP, MySQL, AJAX & Zend Certification EVS MCSE 0 05-31-2010 01:13 PM
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
RE: php and python: how to unpickle using PHP? Ted Zeng Python 0 10-13-2006 12:11 AM
php and python: how to unpickle using PHP? Ted Zeng Python 4 10-03-2006 03:07 PM
Asp.NET Javascript string, want to pass '(single quotes' within '(single quotes) Chris ASP .Net 1 03-24-2006 09:03 PM



Advertisments