Jump to content

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


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 that line is what appears in the browser, then the page it is on is not being parsed as PHP code. Does the page have a .php extension or have you setup your server to parse .htm/.html pages as PHP?

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++;
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.