Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2005
    Messaggi
    37

    Info validator XHTML e simbolo ?

    Ciao a tutti...
    ecco la stringa interessata:

    codice:
    						print "<a href=home.php?pag=$contnpag>$contnpag </a>";
    logicamente è php

    questo è l'errore riportato dal validator, cosa posso fare?
    # Error Line 102 column 19: an attribute value must be a literal unless it contains only name characters.

    <a href=home.php?pag=2>2

    You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.


    # Error Line 102 column 48: an attribute value must be a literal unless it contains only name characters.

    <a href=home.php?pag=2>2

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    La sintassi HTML e XHTML corretta per il tuo codice lato client e`:
    <a href="home.php?pag=1">1</a>
    oppure:
    <a href='home.php?pag=1'>1</a>

    Nota che questo e` vero da HTML2 in poi (ma forse anche HTML1), quindi non e` una novita` introdotta da XHTML.


    Quindi non ti resta che modificare il PHP per fare in modo che venga prodotto quel codice.
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  3. #3
    Utente di HTML.it
    Registrato dal
    Oct 2005
    Messaggi
    37
    niente non va...
    ti posto il codice intero per capire meglio...
    codice:
    			<?PHP
    				for ($contnpag=1;$contnpag<=$contpage2;$contnpag++)
    				{
    					if ($contnpag==$pagattuale)
    					{
    						print "$contnpag ";
    					}
    					else
    					{
    						print "<a href=home.php?pag=$contnpag>$contnpag </a>";
    					}
    				}
    			?>

  4. #4
    Utente di HTML.it L'avatar di pacovox
    Registrato dal
    Oct 2001
    Messaggi
    557
    print "<a href=\"home.php?pag=$contnpag\">$contnpag </a>";

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.