Jump to content

[SOLVED] Is there a way to make this validate (xhtml11)?


DenHepLei

Recommended Posts

Hi,

 

Is there a way to make this validate (xhtml11)?

 

<a href="<?php echo $_SERVER['PHP_SELF'];?>?page=a">A</a>

 

I receive the following error:

 

character "<" is the first character of a delimiter but occurred as data.

 

Thanks,

 

- DenHepLei

 

If you have it within <?php ?> tags already, that'll be why. If not do so and use

 

<?php
echo "<a href=". $_SERVER['PHP_SELF']."?page=a>A</a>";
?>

 

Sam

 

N.B - as far as I'm aware there's no xhtml 11 either. :P 1.1 on the other hand..

 

Hi,

 

This solves my issue:

 

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=a>A</a>";

?>

 

BTW I am aware there is no xhtml 11 (yet...) I just grabbed the snippet of text from my DOCTYPE not thinking about it...

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

 

Thanks for all you help, I should have seen this myself, it's kind of like looking for your car keys while your holding them in you hand the whole time!

 

 

Hi,

 

Is this the best way to write this, it works but seems lengthy...

 

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=a>A</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=c>C</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=d>D</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=e>E</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=f>F</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=g>G</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=m>M</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=n>N</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=p>P</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=s>S</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=t>T</a>";

echo "  ::  "

?>

<?php

echo "<a href=". $_SERVER['PHP_SELF']."?page=y>Y</a>";

?>

 

Thanks,

 

- DenHepLei

Could use range.

 

$range = range('a','z');
$count = count($range);
$x=1;
foreach($range AS $letter){
$space = ($x == $count) ? "  ::  " : "";

echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$letter\">".strtoupper($letter)."</a>" . $space;
$x++;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.