Re: anchor "#" not working?
| From: | Brian White | Date: | Mon, 05 Mar 2001 01:09:50 +0000 |
| Subject: | Re: anchor "#" not working? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-42545@lists.php.net to get a copy of this message | ||
OK. The Following code , when put in a file called "anchortest.php". Seems to work
properly. Might be a good starting point:
<html>
<head><title>PHP Anchor Test</title></head>
<body>
<h2>PHP Anchor Tester</h2>
<?php
if ( ! $NumAnchors ) { $NumAnchors="20"; }
$fname="anchortest.php"
?>
<h4>Regenerate Number of Anchors</h4>
<form method="GET" action="<?php print $fname; ?>" >
<p>Please enter the Number of Anchors:
<input type=text name="NumAnchors" value="<?php print $NumAnchors; ?>" >
</form>
<h4>Select An Anchor To Go To:</h4>
<p>
<?php
for ( $i = 1; $i <= (0 + $NumAnchors) ; $i++ )
{
print "<a href=\"$fname?NumAnchors=$NumAnchors#$i\">[$i]</a> ";} ?> <h4>Generated Anchors</h4> <?php for ( $i = 1; $i <= (0 + $NumAnchors) ; $i++ ) {
print "<p><a name=\"$i\"></a>Generated Anchor number $i \n";} ?> </body> </html> ------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: bwhite@steptwo.com.au