Page 1 of 1

Passing values using POST

Posted: Sun Mar 22, 2009 6:16 am
by zerandib
hi

This is the code related to the form

Code: Select all

<form id="form1" name="form1" method="post" action="saveit.php">
  <label>
  <textarea name="txt1" cols="100" rows="25"></textarea>
  <input type="submit" name="Submit" value="Submit" />
  </label>
</form>
 
when i enter the value "Jane" (with double quote) , and submit i want to display that text
Here the saveit.php

Code: Select all

echo $_POST["txt1"]);
But here it displays as
\"Jane\" (Not as "Jane")

So how to get the out put as "Jane" (with double quote)

Re: Passing values using POST

Posted: Sun Mar 22, 2009 6:27 am
by Inkyskin

Re: Passing values using POST

Posted: Sun Mar 22, 2009 6:34 am
by zerandib
Hi,

yes thts possible...
but i want to do some thing like this as well

when i submit string such as,
<html>
Hi
</html>


i need to show all the text as it is.
that is output , must be like
<html>
Hi
</html>

but currently it shows only: Hi
how to do it?

i want to stop interpreting html. needs to show html as it is.
thanks

Re: Passing values using POST

Posted: Sun Mar 22, 2009 7:05 am
by Inkyskin
In that case, try this: http://uk.php.net/htmlentities

The PHP Manual should be your best friend :)