|
How to stop JavaScript code from executing itself
|
| Author |
Message |
smacker
Member
  
Posts: 234
Group: Registered
Joined: Sep 2007
Status:
Offline
Reputation: 0
Country: 
|
How to stop JavaScript code from executing itself
Hi All,
Suupose in textarea some body enters following code:-
<script language="javascript" >alert('Hi');
How to stop JavaScript code from executing itself when displaying the data.
One way is to stop entring this data into DB thru strip_tags
But in case if such data is present then How to stop it from executing ?
so tht it will just display
Thx All in advance.
|
|
| 09-14-2007 07:33 AM |
|
 |
tina1
Member
  
Posts: 120
Group: Registered
Joined: Sep 2007
Status:
Offline
Reputation: 0
Country: 
|
RE: How to stop JavaScript code from executing itself
I don't really use JavaScript anymore myself the following function should do it; where '$string' is your variable.
htmlEntities($string)
|
|
| 09-14-2007 09:27 AM |
|
 |
Dhanraj
Member
  
Posts: 50
Group: Registered
Joined: Nov 2007
Status:
Offline
Reputation: 0
Country: 
|
RE: How to stop JavaScript code from executing itself
I don't use java scripts at all.Let me ask my friends.they can find solution
|
|
| 11-17-2007 09:52 PM |
|
 |