JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 11th, 2001, 02:28 PM
smedcalf smedcalf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 4 smedcalf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
passing values to javascript functions

How can I pass a value from a php page to a javascript function that calls a pop up window of another php page? Please keep reply in child like terms, thanks.

Reply With Quote
  #2  
Old July 11th, 2001, 02:35 PM
linear linear is offline
Embittered Cynic
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: 38.97° N, 94.67° W
Posts: 11 linear User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: passing values to javascript functions

Quote:
Originally posted by smedcalf
How can I pass a value from a php page to a javascript function that calls a pop up window of another php page? Please keep reply in child like terms, thanks.


Here's an example:

<SCRIPT type="text/javascript">
function rand() {
// shows a random image (randomized at the server)
document.location = "<?php echo "$PHP_SELF?i=$rand" ?>"
}
</SCRIPT>

The document containing this is a .php file, if that's not obvious. This way, you can assign variables, or generate function calls or whatever using variables accessible to your PHP script. Just echo the PHP variables where you want them in your Javascript.
__________________
+++linear+++
PHP Security Questions? start here

Reply With Quote
  #3  
Old July 11th, 2001, 03:06 PM
Emperor Emperor is offline
Divine Wind
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Mongo
Posts: 24 Emperor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Emperor
Re: passing values to javascript functions

Quote:
Originally posted by smedcalf
How can I pass a value from a php page to a javascript function that calls a pop up window of another php page? Please keep reply in child like terms, thanks.


You might want to give us a bit more information if you want a specific answer - is it to the same page or different pages, etc.? It can be done but there are many different combinations and permutations (e.g. I've got some script which sends a value to a search page located in a frame in the pop-up window - the value coming from a drop down menu).

Emps

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > passing values to javascript functions

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap