Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Is there an alternate way to pass data between pages using sessions without using forms on click of an image button.
Posted
Updated 20-Aug-15 20:56pm
v2
Comments
Sergey Alexandrovich Kryukov 21-Aug-15 2:41am    
Sorry, this is not a question. And your considerations are invalid. You are trying to compare PHP and JavaScript, considering them almost as alternatives. They are not. One is used on server side, another on client side. Rather, you need to learn how Wen works in general.
—SA
Member 11040029 21-Aug-15 2:45am    
I already wrote 'I am new to both of these languages'. I am just asking for the a suggestion.
Sergey Alexandrovich Kryukov 21-Aug-15 2:50am    
Your approach is wrong. You need to learn some basics and then ask your questions in more qualified way. Or ask more specific or more elementary questions. But better learn the basics. I already explained why your considerations are invalid.

As to "between page", learn Web Storage. But this is an advanced issue. First, learn the basics.

—SA
Member 11040029 21-Aug-15 3:03am    
Apologies for the wrong approach.I updated my question here.
Sergey Alexandrovich Kryukov 21-Aug-15 10:37am    
No need to apologize, this is just a working moment. I answered, please see Solution 2.
—SA

There's no PHP vs JS. There are instead client side and server side. If you need to pass data from one PHP script to another one then Google is you friend[^]. You are also free of using Google for related searches (e.g. apssing data from JS and PHP).
 
Share this answer
 
v2
Following out discussion in the comment to the question, I can conclude: the question is still not quite correct. Alternative to what? :-)

Anyway, let me bring to your attention on newer approach which is very universal, because it exchanges data independent on your server side, and will work even if you don't have any server. This is Web storage: http://en.wikipedia.org/wiki/Web_storage.

If you want to pass more data at the same key, any arbitrary data structure, you can also use JSON object, to serialize and deserialize data. You can find a comprehensive but short code in this section of my article: JavaScript Calculator, 7. Dynamic Strict Mode Switching and Web Storage.

—SA
 
Share this answer
 
Comments
Member 11040029 21-Aug-15 10:56am    
in alternate to using forms
Sergey Alexandrovich Kryukov 21-Aug-15 11:25am    
All right, I gave you a solution "alternative to everything". Are you going to accept it formally?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900