Re: [PHP] passing PHP variables to Javascript ...
Cpt John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From: Kenn Murrah [EMAIL PROTECTED] I need to be able to pass a PHP variable to a Javascript and can't figure out how to do it. In short, the Javascript win() statement is used open a page as defined in PHP -- i.e., $php_name = http://www.somewhere.com/something/3.jpg; , a filename that was generated dynamically in PHP ... how do I pass that variable to my Javascript routine? script language = JavaScript var mywin = '?=$php_name?'; win(mywin); /script or something like that. ---John Holmes... Yes, is that simple, but if it doesn't work for you (because of the short tag ?= ) use the 'echo' or 'print' commands: [... php code ... ] ? script language = JavaScript var mywin = '?php echo $php_name; ?'; win(mywin); /script ?php [... more code ... ] - Good luck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing PHP variables to Javascript ...
Greetings. I need to be able to pass a PHP variable to a Javascript and can't figure out how to do it. In short, the Javascript win() statement is used open a page as defined in PHP -- i.e., $php_name = http://www.somewhere.com/something/3.jpg; , a filename that was generated dynamically in PHP ... how do I pass that variable to my Javascript routine? (Pardon me if this is more of a Javascript issue than a PHP issue -- I couldn't decide where to ask for help first :-) Thank in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing PHP variables to Javascript ...
From: Kenn Murrah [EMAIL PROTECTED] I need to be able to pass a PHP variable to a Javascript and can't figure out how to do it. In short, the Javascript win() statement is used open a page as defined in PHP -- i.e., $php_name = http://www.somewhere.com/something/3.jpg; , a filename that was generated dynamically in PHP ... how do I pass that variable to my Javascript routine? script language = JavaScript var mywin = '?=$php_name?'; win(mywin); /script or something like that. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing PHP variables into javascript
I am having a problem passing a variable from PHP to Javascript and getting my JS function to recognize a form element object. I am trying to use the selection of a particular option in a dropdown menu to control the visibility of another form control element (another select box). In other words, when the user selects the third option in the menu named petsubtype , the menu named chonpetsub should become visible. Similarly, if the third option is deselected, the latter menu should once again disappear. When I click on any of the options in the first menu (i.e., petsubtype), I get a Javascript warning that says elementname.length is null or not an object. Any help would be greatly appreciated. Thanks in advance, Bill //** *** function PetSubToggle(id, elementname, form) { alert(Function call here successful); for(var i=0; iform.elementname.length; i++){ //alert(starting to cycle through loop); if (form.elementname.options[i].selected == true){ //alert(a selected choice is true); if(i==3){ if(document.getElementById(id).style.visibility){ if(document.getElementById(id).style.getAttribute(visibility)==hidden){ document.getElementById(id).style.setAttribute(visibility,visible)} else if(document.getElementById(id).style.getAttribute(visibility)==visible){ document.getElementById(id).style.setAttribute(visibility,hidden)} else { alert(Your browser does not support proper display of this menu, please upgrade or change browsers.)}; } } } } return false } /SCRIPT !-- //** -- SCRIPT language=php require 'dhtml_functions.inc'; require 'meteor_data_arrays.inc'; //** $petsubname=petsubtype; //used below to assign an name the the petsub div id $elementname=chonpet; //add column for petrologic types $elementsarray=$chon_pet;//an associative array echo form; echo tabletrtd; echo select name='$petsubname' id='$elementname' multiple size='5' onChange='PetSubToggle($petsubname, $elementname, this.form)'; //display petro types in option list, beginning with select all echo option value='$chon_pet[8]' selected$chon_pet[8]/option; echo option value='$chon_pet[1]'$chon_pet[1]/option; echo option value='$chon_pet[2]'$chon_pet[2]/option; echo option value='$chon_pet[3]'$chon_pet[3]/option; echo option value='$chon_pet[4]'$chon_pet[4]/option; echo option value='$chon_pet[5]'$chon_pet[5]/option; echo option value='$chon_pet[6]'$chon_pet[6]/option; echo option value='$chon_pet[7]'$chon_pet[7]/option; echo /select; //** echo /tdtd; echo div id='$petsubname' style='position:relative;left:0px;top:0px;visibility:hidden'; echo select name='chonpetsub' id='chonpetsub' multiple size='5'; echo option value='1'3.1/option; echo option value='2'3.2/option; echo option value='3'3.3/option; echo option value='4'3.4/option; echo option value='5'3.5/option; echo option value='6'3.6/option; echo option value='7'3.7/option; echo option value='8'3.8/option; echo option value='9'3.9/option; echo option value='10'All Types/option; echo /select; echo /div; echo /td/tr/table/form; //** /SCRIPT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing PHP Variables
I need to pass a variable e.g. $var1 from one PHP page to another. The only conditions are that the variable cannot be shown in the source code on the end users machine nor can it be passed visibly within the url. Does anyone have any suggestions on how I can accomplish this? Hippie. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing PHP Variables
Either use sessions or pass it via POST in using a form. -- Ben Sinclair [EMAIL PROTECTED] - Original Message - From: John (News) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 17, 2002 4:48 PM Subject: [PHP] Passing PHP Variables I need to pass a variable e.g. $var1 from one PHP page to another. The only conditions are that the variable cannot be shown in the source code on the end users machine nor can it be passed visibly within the url. Does anyone have any suggestions on how I can accomplish this? Hippie. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing PHP Variables
If you are using sessions, use it as a session variable. --- John (News) [EMAIL PROTECTED] wrote: I need to pass a variable e.g. $var1 from one PHP page to another. The only conditions are that the variable cannot be shown in the source code on the end users machine nor can it be passed visibly within the url. Does anyone have any suggestions on how I can accomplish this? Hippie. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Passing php variables to perl script
Please i want to know how to pass variables (such as $PHP_AUTH_USER and $PHP_AUTH_PW) from php to Perl script which is in apache cgi-bin directory. Thanks in advance for help -- Moise Bertrand TACHAGO Computer scientist Volunteer DBMS Specialist SDNP Cameroon, 506 Hajal Center Building Yaounde CAMEROON (237)22 24 90 E_mail [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]