NameSilo

Help Needed! Text Area & HTML Code In PHP

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

Jake

Senior MemberVIP Member
Impact
56
Basically, I am attempting (and failing) to insert some code that will allow someone to copy and paste code that is generated for them.

Here's an example:

Code:
See how easy it is to copy this?

It allows you to copy everything inside the box, without copying everything else on the page.

I'm doing this in a PHP file, and I'm finding it to be impossible without getting a "Parse Error"

Can anyone help, or put me in the right direction?
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
All you need to do is place it within its own div as it is on this forum.

for example:-

HTML:
<div id='text'>See how easy it is to copy this?</div>

Once you have created the div you could always apply css to it so it stands out.
 
1
Close
Jake said:
I'm doing this in a PHP file, and I'm finding it to be impossible without getting a "Parse Error"
If you still get the parse error, post your PHP code and we should be able to help you. As a guess, it may be that you've added a quote character without escaping it. e.g.

PHP:
echo '<div id='text'>See how easy it is to copy this?</div>';
will generate a parse error. To fix it, you need to escape the quotes by putting a backslash before it, like this:

PHP:
echo '<div id=\'text\'>See how easy it is to copy this?</div>';
 
1
Close
Thanks! I got it to work B-)

Rep coming!
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back