Posted by andy.z on 03/09/07 17:50
I'm confused -
The following outputs a URL encoded string into an alert box
----------------------CUT ----------------------
function createEmbarrasment() {
$tmp = urlencode("Your fly is undone!");
?> <script type="text/javascript"><!--
alert('<?php echo $tmp; ?>')
//--> </script>
<?php
}
-------------------------------
Unfortunately displaying the URL encoded version of the string
If you remover the URL encoding the alert box doesn't even display
Next
Using constants - Again this fails to even open the alert box
----------------------CUT ----------------------
function createEmbarrasment() {
define("TEMP","Your fly is undone!");
?> <script type="text/javascript"><!--
alert('<?php echo TEMP; ?>')
//--> </script>
<?php
}
-------------------------------
AND YET
----------------------CUT ----------------------
function createEmbarrasment() {
?> <script type="text/javascript"><!--
alert('<?php echo PHP_VERSION; ?>')
//--> </script>
<?php
}
-------------------------------
Opens the box and displays fine without URL encoding
MY PROBLEM - I'm trying to do the first example without the display
showing the URL encoding.
Can anyone explain or help please?
-andy-
Navigation:
[Reply to this message]
|