Be a Supporter!

forms question [PHP]

  • 475 Views
  • 5 Replies
New Topic Respond to this Topic
BORKOYz
BORKOYz
  • Member since: Aug. 13, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
forms question [PHP] 2006-12-05 09:47:40 Reply

I have a textfield, you can write stuff in it and u can submit it and it will show what you wrote on another page + it will create a file of wat you wrote, but when you type in a php script like
<?php
echo "YO Yo YO";
?>
it shows
<?php
echo \"YO Yo YO\";
?>
how do you make it so whateva you type in the textfield will show you exactly how you wrote.
Thanx

elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to forms question [PHP] 2006-12-05 09:51:19 Reply

Put this at the top of your script:

set_magic_quotes_runtime(0);


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
BORKOYz
BORKOYz
  • Member since: Aug. 13, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to forms question [PHP] 2006-12-05 10:11:09 Reply

At 12/5/06 09:51 AM, elbekko wrote: Put this at the top of your script:

set_magic_quotes_runtime(0);

nah sorry i cant get it to work
also same problem, if i write
<div align='left'>YO Wats up<br /><br /></div> it actually writes "YO Wats up" its not just the quotes

Loccie
Loccie
  • Member since: Feb. 27, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to forms question [PHP] 2006-12-05 11:36:32 Reply

At 12/5/06 10:11 AM, BORKOYz wrote: also same problem, if i write
<div align='left'>YO Wats up<br /><br /></div> it actually writes "YO Wats up" its not just the quotes

echo '&lt;div align="left"&gt;YO Wats up&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;';

If you want php to convert < to &lt; and > to &gt; you can use $newtext = htmlspecialchars($text);

henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to forms question [PHP] 2006-12-05 14:36:09 Reply

Learn about:
html vs display
magic quotes and how they suck


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

DFox
DFox
  • Member since: Aug. 9, 2003
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to forms question [PHP] 2006-12-05 14:53:30 Reply

Either turn magic quotes gpc off, or use stripslashes()


BBS Signature