Results 1 to 10 of 10

Thread: doing the undoable

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    21

    doing the undoable

    here's my situtation, I already have pages set up on my site using asp. I need to include those pages with my master index.php page. Is there a way to include an asp page in a .php document, basically any way to render both php and asp. The only was I did it so far was with an inline frame

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Well you can't have the PHP parser execute the ASP pages - but you can use the fopen() function to open the page and get the output.
    PHP Code:
    $fhwnd fopen('http://www.mysite.com/index.asp');

    if (
    $fhwnd) {
        
    /* discard headers */
        
    while (! feof($fhwnd) && fgets($fhwnd) != "\r\n");

        
    $output '';

        while (! 
    feof($fhwnd)) {
            
    $output .= fgets($fhwnd);
        }

    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    21
    that does help with some stuff, but I want to use a php referer log script on an asp page, but I think I'll just find an asp logger with referer.

  4. #4
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    I would recommend switching everything to PHP. It's generally not a good idea to mix languages like those 2.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Yeah - ober is right. Go with either one or the other.

    I suppose it would be possible to mix them both if you were able to find a way of puting the file through both an PHP interpreter and the ASP interpreter afterward. I know this would be possible on linux but wouldn't have the first clue how to do it with Windows/IIS.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    21
    I tried the code, it returned

    Warning: fopen() expects at least 2 parameters, 1 given in c:\websites\*\www\index2.php on line 48

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Sorry. I left out on of the arguments. The call to fopen should read:
    PHP Code:
    $fhwnd fopen('http://www.mysite.com/index.asp''r'); 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    21
    now there's no errors, but the page is blank, nothing comes up. Do I have to do something special to write it back to the page?

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yes.
    echo $output;
    is the simplest version. Basically, $output contains everything the ASP page produced.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    21
    I'm so sorry, I realized I could include http://domain.com/blah.asp and it will render it first. I'm so stupid. I'm really sorry you wrote that whole fopen script, sorry for the trouble. I may end up using it somewhere along the line, thanks anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width