Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By GumSlone

Thread: very simple source code viewer script

  1. #1
    Administrator GumSlone's Avatar
    Join Date
    Mar 2005
    Location
    Mars, GumCity
    Posts
    1,494
    Thanks
    125
    Thanked 573 Times in 201 Posts
    Blog Entries
    2
    Rep Power
    10

    Default very simple source code viewer script

    PHP Code:
    <?php
    header
    ('Content-Type: text/html; charset=utf-8');
    echo 
    '<?xml version="1.0"?>
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Source code viewer</title>
    <meta http-equiv="Pragma" content="no-cache" />
    </head>
    <body>'
    ;
    if(isset(
    $_GET['url']) && substr($_GET['url'],0,7) == 'http://')
    {
    $source file_get_contents($_GET['url']);
    echo 
    '<div>Source code</div><div>'.htmlspecialchars($source).'</div><hr/>';
    }

    echo 
    '<form action="'.$_SERVER['PHP SELF'].'" method="get">
    <div>
    Source URL:
    <input type="text" name="url" value="http://" />
    <input type="submit" value="Show source" />
    </div>
    </form>

    </body>
    </html>'
    ;
    ?>
    The Fox likes this.
    Advertise your mobile site for FREE with [Only registered and activated users can see links. Click Here To Register...]

    [Only registered and activated users can see links. Click Here To Register...]


  2. #2
    Junior Member
    Join Date
    Sep 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    where will i put that? add code?

  3. #3
    Senior Member something else's Avatar
    Join Date
    Feb 2008
    Location
    if($something){echo 'Status code 404'; }else{ echo 'coding-talk.com';}
    Posts
    1,818
    Thanks
    209
    Thanked 447 Times in 202 Posts
    Rep Power
    0

    Default

    on a php page

    [Only registered and activated users can see links. Click Here To Register...]


  4. #4
    Senior Member
    Join Date
    Mar 2010
    Location
    India
    Posts
    318
    Thanks
    61
    Thanked 19 Times in 11 Posts
    Blog Entries
    2
    Rep Power
    0

    Default

    Quote Originally Posted by RJNzone [Only registered and activated users can see links. Click Here To Register...]
    where will i put that? add code?
    i think you r very new dude.this is very simple code. create php page and past these code. now ready demo [Only registered and activated users can see links. Click Here To Register...]
    Last edited by akela; 06-09-10 at 11:18.

  5. #5
    Junior Member
    Join Date
    Sep 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    i'm very sorry with that.. where can i learn more? i'm new here sir..

  6. #6
    Junior Member The Fox's Avatar
    Join Date
    Nov 2011
    Location
    Nicaragua
    Posts
    26
    Thanks
    35
    Thanked 8 Times in 2 Posts
    Rep Power
    0

    Default

    Great work! Thanks for sharing

  7. #7
    Member
    Join Date
    Sep 2011
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    2

    Default

    Please add color tags

  8. #8
    Member
    Join Date
    Sep 2010
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Some update To the script
    warping the HTML
    PHP Code:
    <?php 
    header
    ('Content-Type: text/html; charset=utf-8'); 
    echo 
    '<?xml version="1.0"?> 
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <title>Source code viewer</title> 
    <meta http-equiv="Pragma" content="no-cache" /> 
    </head> 
    <body>'

    $source file_get_contents("http://$domain"); 
    $new htmlentities($source); 
    echo 
    '<div>Source code</div><div>'.nl2br($new).'</div><hr/>';  

    echo 
    '<form action="'.$_SERVER['PHP SELF'].'" method="get"> 
    <div> 
    Source URL: 
    <input type="text" name="url" value="http://" /> 
    <input type="submit" value="Show source" /> 
    </div> 
    </form> 

    </body> 
    </html>'

    ?>
    updated these 2Lines

    PHP Code:
    $source file_get_contents("http://$domain"); 
    $new htmlentities($source); 
    echo 
    '<div>Source code</div><div>'.nl2br($new).'</div><hr/>'
    demo at - [Only registered and activated users can see links. Click Here To Register...]
    :p
    Last edited by mkjmkj; 02-09-12 at 10:03.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. YouTube API Feed Reader: Source Code
    By riderz in forum Snippets, Functions and Classes
    Replies: 0
    Last Post: 31-07-10, 14:08
  2. myGame.jar source code for sale $80
    By slash1968 in forum Marketplace
    Replies: 7
    Last Post: 12-04-10, 07:17
  3. simple thanking code
    By nclemale36 in forum Site / Script testing and error fixing
    Replies: 3
    Last Post: 24-10-09, 17:10
  4. Hide codes from Source Code Viewer
    By anderson in forum Coding Forum
    Replies: 12
    Last Post: 24-09-09, 11:17
  5. prodigits source code
    By ripkk2tfk in forum REQUEST FORUM
    Replies: 0
    Last Post: 26-03-09, 13:37

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
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19