note 44456 deleted from function.include by aidan
| From: | aidan@php.net | Date: | Sat, 15 Apr 2006 16:36:57 +0000 |
| Subject: | note 44456 deleted from function.include by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-108171@lists.php.net to get a copy of this message | ||
Note Submitter: unazona at hotmail dot com
----
Hello,
I found away to turn over this, it was like this
strings.php
-----------
switch ($msg_id) {
case 001 : echo "test";break;
case 002 : echo "test2";break;
....}
index.php
------------
<script type=javascript>
msg = '<? $msg_id = 001; include "strings.php"; ?>';
alert(msg);
</script>
...................
Alert doesn't work, because of an additional LF which has been added by include, so I've
changed the code as the follwing
strings.php
-----------
switch ($msg_id) {
case 001 : return "test";
case 002 : return "test2";
....}
index.php
------------
<script type=javascript>
msg = '<? $msg_id = 001; echo include "strings.php"; ?>';
alert(msg);
</script>
---------------
so workss .. good luck , am I right anyway ?????????,,