Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [XHTML] Validacja kawałka kodu
Forum PHP.pl > Forum > Po stronie przeglądarki > HTML \ XHTML
przemasisko
Witam.
Validator czepia się tego kawałka kodu.


  1. <table style="background-color: #ffffff; border: #000000 solid 1px; width:730px; margin-left:auto; margin-right:auto;">
  2. <tr> <td>
  3. <br /><br />
  4. <b>Za chwilę rozpocznie się pobieranie pliku</b><br /><br />
  5. <img src="gfx/loader.gif" alt="" />
  6. <br /><br />
  7. <small>Jeśli pobieranie nie rozpoczęło się automatycznie, poniżej znaduje się twój link:</small><br />
  8. <?php
  9.    class Wrzuta
  10.    {
  11.        public function execute( $url )
  12.        {
  13.            if( !preg_match( '#.*?wrzuta.pl/(audio|film)/([A-z0-9]+)/.*#', $url, $data ) )
  14.            {
  15.            throw new Exception("<b><big>Podany adres nie jest poprawny!.</big></b><br /><br />");
  16.            }
  17.  
  18.            switch( $data[1] )
  19.            {
  20.                case 'audio':
  21.                    $url = 'http://www.wrzuta.pl/aud/file/';
  22.                break;
  23.  
  24.                case 'film':
  25.                    $url = 'http://www.wrzuta.pl/vid/file/';
  26.                break;
  27.            }
  28. $licznik_nabijaj=file("files/counter.txt");
  29. $stan_licznika=$licznik_nabijaj[0]+1;
  30. $licznik_nabijaj=fopen("files/counter.txt","w");
  31. fputs($licznik_nabijaj,$stan_licznika);
  32. fclose($licznik_nabijaj);
  33. echo '<a href="';
  34. echo $url;
  35. echo $data[2];
  36. echo '">';
  37. echo $url;
  38. echo $data[2];
  39. echo '</a>';
  40. echo '<script type="text/javascript">setTimeout( "';
  41. echo "document.location.href='";
  42. echo $url;
  43. echo $data[2];
  44. echo "';";
  45. echo '", 2000 );';
  46. echo '</script>';
  47. // header( 'Location: ' . $url . $data[2] );
  48.        }
  49.    }
  50.    $oWrzuta = new Wrzuta( );
  51.    try
  52.    {
  53.        $oWrzuta -> execute( $_POST['adres'] );
  54.    }
  55.    catch( Exception $ex )
  56.    {
  57.        die( $ex -> getMessage( ) );
  58.    }
  59. ?> <br /><br />
  60. </td></tr></table>



Wysypuje mi następujące błędy:

Cytat
# Error Line 42, Column 62: end tag for "td" omitted, but OMITTAG NO was specified.

…>Podany adres nie jest poprawny!.</big></b><br /><br />



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 36, Column 5: start tag was here.

<tr> <td>

# Error Line 42, Column 62: end tag for "tr" omitted, but OMITTAG NO was specified.

…>Podany adres nie jest poprawny!.</big></b><br /><br />



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 36, Column 0: start tag was here.

<tr> <td>

# Error Line 42, Column 62: end tag for "table" omitted, but OMITTAG NO was specified.

…>Podany adres nie jest poprawny!.</big></b><br /><br />



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 35, Column 0: start tag was here.

<table style="background-color: #ffffff; border: #000000 solid 1px; width:730px;

# Error Line 42, Column 62: end tag for "body" omitted, but OMITTAG NO was specified.

…>Podany adres nie jest poprawny!.</big></b><br /><br />



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 33, Column 0: start tag was here.

<body>

# Error Line 42, Column 62: end tag for "html" omitted, but OMITTAG NO was specified.

…>Podany adres nie jest poprawny!.</big></b><br /><br />



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 2, Column 0: start tag was here.

<html xmlns="http://www.w3.org/1999/xhtml">

# Error Line 42, Column 62: XML Parsing Error: Premature end of data in tag td line 36.

…>Podany adres nie jest poprawny!.</big></b><br /><br />


# Error Line 42, Column 62: XML Parsing Error: Premature end of data in tag tr line 36.

…>Podany adres nie jest poprawny!.</big></b><br /><br />


# Error Line 42, Column 62: XML Parsing Error: Premature end of data in tag table line 35.

…>Podany adres nie jest poprawny!.</big></b><br /><br />


# Error Line 42, Column 62: XML Parsing Error: Premature end of data in tag body line 33.

…>Podany adres nie jest poprawny!.</big></b><br /><br />


# Error Line 42, Column 62: XML Parsing Error: Premature end of data in tag html line 2.

…>Podany adres nie jest poprawny!.</big></b><br /><br />


Da się to poprawić? Pozdrawiam.
phpion
Cytat(przemasisko @ 19.03.2009, 21:58:59 ) *
Da się to poprawić?

Zapewne tak. Ale co: mamy to za ciebie zrobić? To jest zlecenie? Komunikaty masz jasne i klarowne więc spróbuj samemu sobie z tym poradzić.

Cytat(przemasisko @ 19.03.2009, 21:58:59 ) *
Pozdrawiam.

Ja również.
przemasisko
Męczę się od paru godzin z tym i nie daję rady. Dlatego napisałem.

Chodzi mu o ten kawałek kodu:

  1. <?php
  2. throw new Exception("<b><big>Podany adres nie jest poprawny!.</big></b><br /><br />");
  3. ?>


Tylko, że ja nie widzę, żeby coś w nim było nie tak :/
erix
Z tego, co pamiętam, to <b> nie ma w XHTML strict, <big> pewnie też.

Poza tym, daruj sobie tabelki.
przemasisko
do zamknięcia.
poradziłem se smile.gif
pozdrawiam.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.