Current location: Hot Scripts Forums » General Web Coding » JavaScript » Sending variables via javascript


Sending variables via javascript

Reply
  #1 (permalink)  
Old 07-22-09, 07:36 PM
Gaug Gaug is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Sending variables via javascript

Hello.

I'd be great if someone could tell me, how to send variables between pages in javascript, and how to receive them in the other page too.

I also had another doubt, that javascript variable, how could I pass it to PHP to work with it, Is there any way to do this?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 07-22-09, 09:35 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
To have variable data persist between pages, it usually has to be saved on the server side using session variables.

You can use forms to send data to PHP or use AJAX.
Reply With Quote
  #3 (permalink)  
Old 07-23-09, 08:29 AM
Gaug Gaug is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by wirehopper View Post
To have variable data persist between pages, it usually has to be saved on the server side using session variables.

You can use forms to send data to PHP or use AJAX.
Ok, but... how would that be I mean, how would I send the data and receive it via javascript and then pass it to PHP, could you post a code as an example?

Thanks in advance.
Reply With Quote
  #4 (permalink)  
Old 07-24-09, 12:37 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Cookie example: JavaScript Cookies

Passing data from javascript to PHP: PHP Forms

AJAX: AJAX Introduction
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending variables jonnekke PHP 11 07-23-08 04:01 AM
Running javascript before sending php mail phpdoctor PHP 3 04-04-07 03:47 PM
Passing javascript variables to new page... Tim Mousel JavaScript 1 01-29-05 03:23 PM
sending variables between pages ? shadi PHP 6 08-20-04 07:38 AM


All times are GMT -5. The time now is 01:53 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.