FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » error while call php function in javascript?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: error while call php function in javascript? [message #173886 is a reply to message #173883] Wed, 11 May 2011 14:31 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Jeff North wrote:

> Amit Prakash Pawar wrote:
>> | // Javascript
>> |
[/color]
[color=teal]>> | var my_url=document.getElementById('url').value;[/color]
[color=teal]>> | [/color]
[color=teal]>> | // my_url='http://www.test.com';[/color]
[color=teal]>> | [/color]
[color=teal]>> | var final_post_url=<?=encrypt_url(my_url)?>;[/color]
[color=teal]>> | alert(final_post_url);[/color]
[color=teal]>> | 
[/color]
>> | how to get correct encrypted data through java script?
>
> try (note the quotes placement:
> var final_post_url="<?=encrypt_url(my_url)?>";

But `my_url' still is the identifier of a *client-side* variable, which
exists only *after* PHP has parsed the code, substituted the `<?php … ?>'
sections, and returned the result to the Web server for it to include
it in its HTTP response.

Please do not post attribution novels.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PHP Document
Next Topic: php unit test framework suggestions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 20:06:58 GMT 2024

Total time taken to generate the page: 0.05187 seconds