Alternative to $ _GET [& ldquo; param] to keep line breaks% 0A?

advertisements

I am sending info from an HTML form through the URL to be used at the destination web page.

One of these bits of info is a user defined message from a textarea, potentially with line breaks. I've encoded the linebreaks as %0A.

I wanted to use $var = $_GET["param"] to retrieve the message and store in a variable, but of course $_GET strips the %0A and replaces with spaces, which is killing the user formatting.

Is there someway I can get this into the variable either with the %0A in tact, or converted to <br>'s.

Thanks for you help.


UPDATE: Here's the code

Example URL:

http://blahblahblah.com/thankyou.php?type=e&gift=1&[email protected]&rname=Simon&[email protected]&dname=Simon&msg=e.g.%20Dear%20Bob,%20%0A%0AMerry%20Christmas%20and%20a%20Happy%20New%20Year%20to%20you.%20I%20hope%202014%20brings%20you%20much%20joy%20and%20happiness%20to%20you%20and%20your%20loved%20ones.%0A%0ABest%20Wishes,%0A%0ADave%0A%0A%20

PHP processing URL:

         <?php

            if ( "e" == $_GET["type"]) :
                $gift_type = "Ecard";
            else :
                $gift_type = "PDF";
            endif;

            $gift_number = $_GET['gift'];

            $donor_name = $_POST['dname'];
            $donor_email = $_GET['demail'];

            $recipient_name = $_POST['rname'];
            $recipient_email = $_GET['remail'];

            $custom_text = $_POST['msg'];

            echo $_POST['msg'];


Use POST instead of GET. This works fine.

form.php

<form method="POST" action="my_form.php">
    <input type="text" name="param">
    <input type="submit">
</form>

my_form.php

<?php
echo $_POST['param'];
?>