Re: [PHP] Reading posted form variables

2005-03-16 Thread Jochem Maas
Simon Allison wrote:
Hey,

 

Obviously this has something to do with the quotation marks in the a href
statement, however I am new to php and my attempts using addslashes and
stripslashes have failed. I would be most grateful if anyone could help me. 

addslashes() and stripslashes() won't help completely (although you may 
still need to
escape quotes - depending on the way you call the following funcs...)
- take a look at htmlentities() and htmlspecialchars(), basically you need to 
encode
you 'msg' so that any HTML contained in the message is not rendered by the 
browser.
 

Cheers,
Simon
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reading posted form variables

2005-03-15 Thread Ligaya Turmelle
I cheat.  when I am putting something into a hidden field that will have 
HTML - I base64_encode it.  then when the receiving page gets it I 
decode it.  It keeps the html from accidentally showing up and "hides" 
it from the user.  It's ugly - but effective.

Simon Allison wrote:
Hey,
 

I have a form which allows users to enter a message and then submits to a
confirmation page which displays the submitted message, and it has a form
with a hidden field which uses php to retrieve the message posted from the
initial page and posts that message if the user clicks the submit button
which confirms that it is correct.
 

However included in the message is a link to a file, and while the message
is displayed correctly on the confirmation page, it has trouble putting the
message into the hidden field, (some goes in the field and some is printed
on the webpage. The code I have used to retrieved the message and store it
in the hidden field is:
 


 

However, when I ran the script all that as stored in the hidden field was:
 

Please use the link below to download my newsletter

 

And on the confirm page where the hidden field is the page had written:
 

Click here to download and view newsletter " >
 

Obviously this has something to do with the quotation marks in the a href
statement, however I am new to php and my attempts using addslashes and
stripslashes have failed. I would be most grateful if anyone could help me. 

 

Cheers,
Simon
 


--
Respectfully,
Ligaya Turmelle
"Life is a game so have fun"
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Reading posted form variables

2005-03-15 Thread Simon Allison
Hey,

 

I have a form which allows users to enter a message and then submits to a
confirmation page which displays the submitted message, and it has a form
with a hidden field which uses php to retrieve the message posted from the
initial page and posts that message if the user clicks the submit button
which confirms that it is correct.

 

However included in the message is a link to a file, and while the message
is displayed correctly on the confirmation page, it has trouble putting the
message into the hidden field, (some goes in the field and some is printed
on the webpage. The code I have used to retrieved the message and store it
in the hidden field is:

 



 

However, when I ran the script all that as stored in the hidden field was:

 

Please use the link below to download my newsletter

 

Obviously this has something to do with the quotation marks in the a href
statement, however I am new to php and my attempts using addslashes and
stripslashes have failed. I would be most grateful if anyone could help me. 

 

Cheers,

Simon