PHP echo _POST problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • captainyellowshirt
    New Member
    • Feb 2007
    • 1

    PHP echo _POST problem

    Hi,

    I'm having a little trouble using a simple for to post information.
    Here is my form.

    <form action="testing .php" method="post" target="_blank" >
    <b>Your Code:</b><br />
    <textarea name="code" rows="5" cols="50"></textarea>
    <input type="submit" value="Preview" />
    </form>

    Landing page.

    <?php echo $_POST["code"]; ?>

    When you submit anything with a single or double quotation ( ' or " ), on the landing page a slash ( \ ) is inserted right before the quotation.

    This: href="www.myURL .com" entered into the form will submit and post like this on the following page: href=\"www.myUR L.com\"

    This form worked on my previous host just fine but not on my new one. Does anyone have any suggestions?
  • cassbiz
    New Member
    • Oct 2006
    • 202

    #2
    I can't see what the problem is. I uploaded it onto my server, PHP version 5.1.6, and it worked great.

    I recommend that you call your host and find out.

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Just means that magic_quotes is on on you new host server.

      Use [php]<?php echo stripslashes($_ POST["code"]); ?>[/php] to remove the quotes.

      Ronald :cool:

      Comment

      Working...