I am trying to fix this simple coding problem for many days, but its not working everytime, I am posting in hope that some one will help this time.

I am having two pages Page1.php and Page2.php. Page1 is having a text box when I enter some code here its not receiving exactly in Page2 everytime its missing some characters, because of that I am not able to use the received code in Page2.


     <form name="f1" method="post" action="/Page2.php">
     <input type=text name=url>
     <input type=submit>


        echo stripslashes(html_entity_decode($_POST['url']));

I entered below value in Page1's text box


In Page2 I am getting the below value



ie. '&amp;' is received as '&' in Page2.

My expectation is to receive whatever text/code I enter in Page1's textbox should be received as it is with out any changes in Page2.


Recommended Answers

All 6 Replies

Thanks for your reply, its working fine in IE but not working in Chrome, any idea?

Do you mean Chrome is still decoding the entered text despite removing the html_entity_decode? Or is something else happening? Have you changed anything in the code from your previous post?

I didn't do any changes in code, something is happening in Chrome.

Change decode to encode, try that and post back

encode is not working, its giving the following error message.

Call to undefined function html_entity_encode()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.