Passing values using POST

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zerandib
Forum Newbie
Posts: 16
Joined: Tue Dec 16, 2008 12:17 am

Passing values using POST

Post 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)
User avatar
Inkyskin
Forum Contributor
Posts: 282
Joined: Mon Nov 19, 2007 10:15 am
Location: UK

Re: Passing values using POST

Post by Inkyskin »

zerandib
Forum Newbie
Posts: 16
Joined: Tue Dec 16, 2008 12:17 am

Re: Passing values using POST

Post 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
User avatar
Inkyskin
Forum Contributor
Posts: 282
Joined: Mon Nov 19, 2007 10:15 am
Location: UK

Re: Passing values using POST

Post by Inkyskin »

In that case, try this: http://uk.php.net/htmlentities

The PHP Manual should be your best friend :)
Post Reply