Results 1 to 10 of 10
  1. #1

    Default Check if Tags are closed... how?



    guyz i need your help...

    i just want your idea on how to check if HTML TAGS are CLOSED...

    how?

    any codes: asp, vbscript, javascript, html, css, etc...


    thanks!


    yeah! bling bling men...abz'

  2. #2

    Default Re: Check if Tags are closed... how?

    use an html editor or any text editor that has syntax highlighting. it makes coding and debugging a lot faster.

    i recommend using notepad++ (freeware) or ultra edit (30 days trial).

    or you can just simply practice syntax indenting so you can easily track down which tags weren't closed.

  3. #3

    Default Re: Check if Tags are closed... how?

    that's not what i mean...

    what i mean bai kay dili ang editors ang mo-detect ani... ako pasabot nga ang CODES sa programmer ang mka padetect ani

    or kung naay built in functions pwede pod

    example:
    javascript, vbscript, asp, php etc...

    yeah! bling bling men...abz'

  4. #4

    Default Re: Check if Tags are closed... how?

    aw ok... sorry mao akong pagsabot. hehe ^___^

    its quite simple really... i have written a quick and dirty php code of what you're looking for. it involves three files.

    1- html form (incase you want it to be submitted) (html_submit.html)
    2- an html obfuscater written in php (check_tags.php)
    3- a sample html file for your html obfuscater (sample.html)

    html_submit.html
    Code:
    <html>
    <head>
    <title>Check HTML Tags</title>
    </head>
    <body>
    <form action="check_tags.php" method="post" enctype="multipart/form-data" target="_parent">
    <input name="file" type="file" id="file">
    <input type="submit" name="Submit" value="Submit" />
    </form>
    </body>
    </html>
    check_tags.php
    Code:
    <?
    $htmlFile = $_FILES['file']['name'];
    
    echo "<p>Checking $htmlFile...</p>";
    
    $handle = fopen($htmlFile, "r");
    $contents = stripslashes(fread($handle, filesize($htmlFile)));
    fclose($handle);
    
    $openFile = strtok($contents, "<");
    
    $open = 0;
    $close = 0;
    $count = 0;
    
    while ($openFile !== false)
    {
    	if (strstr($openFile, ">"))
    	{
    		$x = substr($openFile, 0, strpos($openFile, ">"));
    		if (strstr($x, "/")) { $close++; }
    		else { $open++; }
    	}
    	$openFile = strtok("<");
    	$count++;
    }
    
    echo "There are $open open tags.<br>";
    echo "There are $close close tags.<br>";
    echo "Total tags found: $count<br><br>";
    
    if ($open !== $close)
    {
    	if ($open>$close) $i = $open-$close;
    	echo "Warning there are $i unclosed tag/s.";
    }
    ?>
    sample.html
    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    
    <body>
    <p> Some table... </p>
    <table>
     <tr>
      <td>Row1</td>
      <td>Row2</td>
      <td>Row3</td>
     </tr>
    </table>
    <p>Some text...</p>
    <p><a href="#link">Broken link</p>
    </body>
    </html>
    Note: there is an unclosed anchor tag in this sample.

  5. #5

    Default Re: Check if Tags are closed... how?

    although it only works with simple html documents... kung imong i-parse na html document naay css or javascript sa source code, then mo-generate na cya og error.

  6. #6

    Default Re: Check if Tags are closed... how?

    Quote Originally Posted by flashfreak
    although it only works with simple html documents... kung imong i-parse na html document naay css or javascript sa source code, then mo-generate na cya og error.
    ok lang bro... at least you've help me...


    i will try to study your codes later...

    im copying the codes and paste it w/ the filename you have given...

    thank you very much


    yeah! bling bling men...abz'

  7. #7
    hi to all.. lam nyo code sa like button??

  8. #8
    Ayo ..hehe

  9. #9
    kinsa butan hehe patabang sa html

  10. #10
    Quote Originally Posted by _i.t_ View Post
    hi to all.. lam nyo code sa like button??
    read first about php mysql then javascript programming or you can try jquery. its more than just plain html

  11.    Advertisement

Similar Threads

 
  1. Replies: 3
    Last Post: 12-22-2007, 03:14 PM
  2. checking if the OPEN TAG has a CLOSE TAG
    By kibotizer in forum Programming
    Replies: 15
    Last Post: 04-09-2007, 09:28 AM
  3. How to check if my psu is under power?
    By etgo in forum Computer Hardware
    Replies: 3
    Last Post: 03-29-2007, 08:49 PM
  4. How to check if ok ang bios sa mobo?
    By etgo in forum Computer Hardware
    Replies: 2
    Last Post: 05-27-2006, 08:15 PM
  5. MONITOR... How to check if maayu pa
    By FREDS in forum Computer Hardware
    Replies: 3
    Last Post: 11-03-2005, 11:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top