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 June 13th, 2001, 05:20 AM
JohanW JohanW is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 3 JohanW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Javascript to PHP ?

Is there a way to convert a variable in java to PHP?

Reply With Quote
  #2  
Old June 13th, 2001, 06:36 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
Yes but not withut a page refresh, you can set a cookie in javascript that PHP can then access, or you can include a javascript variable in a link or form input, ie

<script>
function go(){
var thisvar="wombat";
location.href='next.php?var='+thisvar;
}
</script>

when called this would redirect to next.php where you can call the variable $var
__________________
resistance is no longer futile :: 423

Reply With Quote
  #3  
Old June 13th, 2001, 08:34 AM
JohanW JohanW is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 3 JohanW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I would prefer not to refresh the page.

Would it be possible to do this by including the script code from another file?

Code:
<script LANGUAGE="javascript" src="http://URL_TO_CODE.php?var=+top.location"></script>


This doesn't work. But is it possible to do it in a similair way and include the variable there. E.g. if you could do:

<script>

include the file

</script>

somehow?

Reply With Quote
  #4  
Old June 13th, 2001, 09:58 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Central Florida, USA
Posts: 2,306 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 6 h 42 m 51 sec
Reputation Power: 60
This question was asked just a couple of days ago. See my responses in this thread.
__________________
The real n-tier system:

FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

Amazon wishlist -- rycamor (at) gmail.com

Reply With Quote
  #5  
Old June 13th, 2001, 10:13 AM
Timeimp Timeimp is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 Timeimp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Timeimp
thats cool

So in ensence... Your writing the javascript on the fly to the browser while the php parser is still running on the server dishing out more javascript...

Still trying to get a grasp on all this stuff.....


TimeImp

Reply With Quote
  #6  
Old June 13th, 2001, 10:35 AM
JohanW JohanW is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 3 JohanW User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
This question was asked just a couple of days ago. See my responses in this thread.


Thanks! Your solution worked.


Quote:
So in ensence... Your writing the javascript on the fly to the browser while the php parser is still running on the server dishing out more javascript...


That's correct. I want my customers to add a certain javascript that will load some stuff from my server, but I need to know on what site they added the javascript.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript to PHP ?

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