Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin3!goblin.stu.neva.ru!newsfeed2.funet.fi!newsfeeds.funet.fi!uio.no!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-Id: <4283243.ZASKD2KPVS@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 11 May 2011 16:31:05 +0200 User-Agent: KNode/4.4.7 Content-Transfer-Encoding: 8Bit 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 MIME-Version: 1.0 Lines: 31 NNTP-Posting-Date: 11 May 2011 16:31:08 CEST NNTP-Posting-Host: 4e063e38.newsspool3.arcor-online.net X-Trace: DXC=Q9J8dgT0nG0nBOkdL^Lo7>McF=Q^Z^V384Fo<]lROoR18kF0DZm8W4\YJN Amit Prakash Pawar wrote: >>| // Javascript >>| [code] >>| var my_url=document.getElementById('url').value; >>| >>| // my_url='http://www.test.com'; >>| >>| var final_post_url=; >>| alert(final_post_url); >>| [/code] >>| how to get correct encrypted data through java script? > > try (note the quotes placement: > var final_post_url=""; But `my_url' still is the identifier of a *client-side* variable, which exists only *after* PHP has parsed the code, substituted the `' 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