Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1523

Re: error while call php function in javascript?

Message-Id <4283243.ZASKD2KPVS@PointedEars.de>
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2011-05-11 16:31 +0200
Subject Re: error while call php function in javascript?
Newsgroups comp.lang.php
References <3ece3c5d-94b1-4fea-9af7-08657b1eaae5@d19g2000prh.googlegroups.com> <215ls6ppav5asq72thq1qobc6k4bmiea2l@4ax.com>
Followup-To comp.lang.php

Followups directed to: comp.lang.php

Show all headers | View raw


Jeff North wrote:

> Amit Prakash Pawar wrote:
>>| // Javascript
>>| [code]
>>| var my_url=document.getElementById('url').value;
>>| 
>>| // my_url='http://www.test.com';
>>| 
>>| var final_post_url=<?=encrypt_url(my_url)?>;
>>| alert(final_post_url);
>>| [/code]
>>| 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

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

error while call php function in javascript? Amit Prakash Pawar <amitppawar2007@gmail.com> - 2011-05-11 05:10 -0700
  Re: error while call php function in javascript? Tim Streater <timstreater@waitrose.com> - 2011-05-11 14:30 +0100
  Re: error while call php function in javascript? Gregor Kofler <usenet@gregorkofler.com> - 2011-05-11 15:38 +0200
  Re: error while call php function in javascript? Jeff North <jnorthau@yahoo.com.au> - 2011-05-11 23:51 +1000
    Re: error while call php function in javascript? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-11 16:31 +0200

csiph-web