Unstoppable Domains โ€” Expired Auctions

PHP Question

Spacemail by SpaceshipSpacemail by Spaceship
Watch

TWM

Web Marketing SpecialistEstablished Member
Impact
9
In HTML, you can type for example:

<a href="index.html#paragraph2">Paragraph2</a>

And next to the second paragraph, you put:

<a name="paragraph2" id="paragraph2"></a>

When you click the link, it takes you to the second paragraph... How do you do this in PHP?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
idevisedesign said:
In HTML, you can type for example:

<a href="index.html#paragraph2">Paragraph2</a>

And next to the second paragraph, you put:

<a name="paragraph2" id="paragraph2"></a>

When you click the link, it takes you to the second paragraph... How do you do this in PHP?

If I get what you are asking you would do the following:

<?php
......php code here
?>
<a href="index.html#paragraph2">Paragraph2</a>

<? ... php continues ?>

<a name="paragraph2" id="paragraph2"></a>

<? ....continue on with php

//end of php
?>
 
0
•••
Or:

echo '<a href="index.html#paragraph2">Paragraph2</a>';
 
0
•••
I am saying that all extensions are being changed to php, so instead of
<a href="index.html#paragraph2">Paragraph2</a>

I basically need something like
<a href="index.php#paragraph2">Paragraph2</a>

The one with the php extension wont work. What should i replace the "#" with so that it works with a .php extension?
 
0
•••
if it is within the php tags (<?php and ?>) then im sure the # has to be escaped so try:-

<a href="index.php\#paragraph2">Paragraph2</a>
 
0
•••
idevisedesign said:
I am saying that all extensions are being changed to php, so instead of
<a href="index.html#paragraph2">Paragraph2</a>

I basically need something like
<a href="index.php#paragraph2">Paragraph2</a>

The one with the php extension wont work. What should i replace the "#" with so that it works with a .php extension?

It should work regardless of page extension, it can be "foo.bar#paragraph2" and should still work. Try making sure you're name anchors are properly labelled and working. It's got nothing to do with php.

Cheers
 
0
•••
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back