Digital Point Forums
Send Money Online

Go Back   Digital Point Forums > Design & Development > Programming > JavaScript
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Feb 8th 2005, 6:06 am
vijaykoul vijaykoul is offline
Grunt
 
Join Date: Jan 2005
Posts: 43
vijaykoul is on a distinguished road
Using Javascript and PHP

Hi everybody,

I want a value calculated in Javascript to be used in PHP b'coz that value
will act as an argument for the function defined in PHP. Can I do it

If yes, how?

One thing I want to tell is that that function is to be defined in PHP only and not i Javascript.

In short can I use a value calculated variable of Javascript in PHP.

It is urgent...
Need help.

Thanx
VJ
Reply With Quote
  #2  
Old Feb 8th 2005, 7:47 am
digitalpoint's Avatar
digitalpoint digitalpoint is offline
My cat is on Prozac... really. lol
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 22,364
digitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond repute
Phone Verified
Not directly... JavaScript is client-side and PHP is server-side. The best you would be able to do is calculate whatever you want to calculate in JavaScript, then have the JavaScript trigger the loading of a page with that value within the URL (or a field in a form post) so PHP could evaluate it.
__________________
- Shawn
Keyword Tracker now supports Google (once again) as well as Bing (new) and Yahoo
Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends.
Reply With Quote
  #3  
Old Feb 8th 2005, 9:02 am
Josh's Avatar
Josh Josh is offline
Twilight Vanquisher
 
Join Date: Dec 2004
Location: Dillwyn, VA
Posts: 893
Josh will become famous soon enoughJosh will become famous soon enough
Yes, the way Shawn just mentioned is about the only way to do it.

i.e. have the javascript do a window.location = 'file.php?varible=thevar' and have the PHP file use $_GET['varible'] to get it..


Josh
__________________
I'm Josh. And after a year and of half of absence, I'm back!

join diggboss or invite link 2
Reply With Quote
  #4  
Old Feb 9th 2005, 2:32 am
vijaykoul vijaykoul is offline
Grunt
 
Join Date: Jan 2005
Posts: 43
vijaykoul is on a distinguished road
the problem now is that all the values i have calculated in Javascript have to be passed to a Payment gateway file and hence i dont think i wil be able to $_GET them.

any other alternative
Reply With Quote
  #5  
Old Mar 12th 2005, 7:37 am
dtan dtan is offline
Peon
 
Join Date: Mar 2005
Posts: 25
dtan is on a distinguished road
couldn't you write a wrapper file that would simply retrieve the get or post value and then call or include the necessary file?
__________________
My Blog | Hosting |
Reply With Quote
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript vs. PHP links digitalpoint PHP 9 Jan 23rd 2008 1:47 am
javascript, php accessing form elements dave ner0tic JavaScript 4 Dec 12th 2005 11:38 am
javascript, php utrosa JavaScript 1 Jan 18th 2005 1:29 am
Javascript or PHP World Clocks Coding? misohoni JavaScript 8 Sep 17th 2004 1:59 am
Help Needed on Converting specific javascript commands to php such as math.random() ProductivePC PHP 4 Jun 6th 2004 3:34 am


All times are GMT -8. The time now is 2:16 am.