[PHP-DB] Passing the value of a variable from PHP to JavaScript.

2004-02-27 Thread Prabu Subroto
Dear my friends...

I have my code like this :
==


function tes(){
document.write('

JavaScript

'); window.location.replace('http://192.168.23.1/coba/coba.php?vtes=$vtes'); } "; echo "diforward ke javascript"; echo " 1 2 "; ?> == I expect this result on url column of my internet browser: " http://192.168.23.1/coba/coba.php?vtes='1' " or " http://192.168.23.1/coba/coba.php?vtes='1' " But I only get this unexpected result: " http://192.168.23.1/coba/coba.php?vtes= " Lookslike the value of "$vtes" was not passed to JavaScript interpreter. Anybody of you have a solution for me? Please teach me. Thank you very much. -- _ Web-based SMS services available at http://www.operamail.com. >From your mailbox to local or overseas cell phones. Powered by Outblaze -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

SV: [PHP-DB] Passing the value of a variable from PHP to JavaScript.

2004-02-27 Thread Henrik Hornemann
Hi,

Where is the value of $vtes comming from? If it's a parameter in the
call of your script, try something like


function tes(){
document.write('<p>JavaScript</p>');
window.location.replace('<a  href="http://192.168.23.1/coba/coba.php?vtes=">http://192.168.23.1/coba/coba.php?vtes=</a><?=$_GET
["vtes"]?>');

}


diforward ke javascript


1
2




Hth Henrik Hornemann

-Oprindelig meddelelse-
Fra: Prabu Subroto [mailto:[EMAIL PROTECTED] 
Sendt: 27. februar 2004 10:03
Til: [EMAIL PROTECTED]
Emne: [PHP-DB] Passing the value of a variable from PHP to JavaScript.


Dear my friends...

I have my code like this :
==


function tes(){
document.write('<p>JavaScript</p>');
window.location.replace('<a  href="http://192.168.23.1/coba/coba.php?vtes=$vtes">http://192.168.23.1/coba/coba.php?vtes=$vtes</a>');

}


";

echo "diforward ke javascript";

echo "


1
2

";
?>


==

I expect this result on url column of my internet browser:
"
http://192.168.23.1/coba/coba.php?vtes='1'
"
or
"
http://192.168.23.1/coba/coba.php?vtes='1'
"

But I only get this unexpected result:
"
http://192.168.23.1/coba/coba.php?vtes=
"

Lookslike the value of "$vtes" was not passed to JavaScript interpreter.

Anybody of you have a solution for me?

Please teach me.

Thank you very much.
-- 
_
Web-based SMS services available at http://www.operamail.com. From your
mailbox to local or overseas cell phones.

Powered by Outblaze

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Passing the value of a variable from PHP to JavaScript.

2004-02-27 Thread Steve Davies
Hi Prabu

you need to add a few bits:

in the function:
function tes(){
vtes = theform.vtes.value;   #added line
document.write('JavaScript');
window.location.replace('http://127.0.0.1/coba/coba.php?vtes=' + vtes); 
#altered line

in the body:

and  before the 

may be a bit ott but should work

steve
}


Prabu Subroto wrote:

Dear my friends...

I have my code like this :
==


function tes(){
document.write('

JavaScript

'); window.location.replace('http://192.168.23.1/coba/coba.php?vtes=$vtes');

}


";
echo "diforward ke javascript";

echo "


1
2

";
?>


==
I expect this result on url column of my internet browser:
"
http://192.168.23.1/coba/coba.php?vtes='1'
"
or
"
http://192.168.23.1/coba/coba.php?vtes='1'
"
But I only get this unexpected result:
"
http://192.168.23.1/coba/coba.php?vtes=
"
Lookslike the value of "$vtes" was not passed to JavaScript
interpreter.
Anybody of you have a solution for me?

Please teach me.

Thank you very much.
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Passing the value of a variable from PHP to JavaScript.

2004-02-27 Thread Pavel Lobovich
Here is the working code:



function tes(){
document.write('

JavaScript

'); o=document.getElementById('myselect'); window.location.replace('http://192.168.23.1/coba/coba.php?vtes='+o.value); } "; echo "diforward ke javascript"; echo " 1 2 "; ?> == That's all Best regards, Pavel. I expect this result on url column of my internet browser: " http://192.168.23.1/coba/coba.php?vtes='1' > " > or > " > http://192.168.23.1/coba/coba.php?vtes='1' > " > > But I only get this unexpected result: > " > http://192.168.23.1/coba/coba.php?vtes= > " > > Lookslike the value of "$vtes" was not passed to JavaScript > interpreter. > > Anybody of you have a solution for me? > > Please teach me. > > Thank you very much. > -- > _ > Web-based SMS services available at http://www.operamail.com. > >From your mailbox to local or overseas cell phones. > > Powered by Outblaze -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php