SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast cragthehack's Avatar
    Join Date
    Jul 2001
    Location
    Ft. Lauderdale, FL. USA
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stripping ASP code

    I'm converting a site from ASP to PHP. I need some tool that will strip all the ASP tags from a page.. anyone know of one?
    - crag
    net geek for non profits and political campaings

  2. #2
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can write you a pretty quick ASP script that will remove all ASP from a file.
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG

  3. #3
    SitePoint Enthusiast cragthehack's Avatar
    Join Date
    Jul 2001
    Location
    Ft. Lauderdale, FL. USA
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Funny. Yeah I guess i could that in PHP too. I was hopeing to find a tool that would strip out lots of things... Myabe EditPlus will do it?
    - crag
    net geek for non profits and political campaings

  4. #4
    SitePoint Enthusiast geeOff's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta, GA 30328
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Crag --

    have you tried ASP2PHP yet ? http://asp2php.naken.cc/ pretty nice with a good amount of VB to PHP translations, but expect to hand-tweak certain things...especially string parsing.

    i had to install the main executable...then i followed a link from their site to get a nice little GUI that works for windows...http://hem.passagen.se/lindau/apwg/news.htm



    Geoff

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should work for stripping asp code from a file in PHP.

    PHP Code:
    <?
    $file = 'foo.asp';
    $fp = fopen($file, "r");
    if($fp) {
        while(!feof($fp)) {
            $data .= fgets($fp, 1024);
            }
        fclose($fp);
        $out = fopen($file, "w");
        $data = ereg_replace("<%[^%>]*%>", "",$data);
        if($out) {
            fputs($out, $data);
            fclose($out);
            }
        else {
            print "Error opening $file for writing";
            }
        }
    else {
        print "Error opening $file for reading";
        }
    ?>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Enthusiast cragthehack's Avatar
    Join Date
    Jul 2001
    Location
    Ft. Lauderdale, FL. USA
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks geeOff and freddydoesphp.
    - crag
    net geek for non profits and political campaings


Bookmarks

Posting Permissions

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