473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to Share variables among php and html

3
Hi Experts,
I have created a login page in php called login.php, it accepts username, password and domain and then does some authentication. IF authentication succeeds it starts a php session and sets a session attribute. In my php application, i check this session attribute in all the pages to find out whether the user has logged in or not.

Now I have another application entirely written in html. Now I want to call this login.php page when a user tries to access any html page. Now the problem is ,I can call the login.php page using a simple javascript call but once the user enters the credentials and gets authenticated how will I pass the knowledge to the html page that the session variable is created, because if the html page does not recognize the creation of php session variable, it will again throw login.php page for users.

Please let me know how can I reuse my login.php page successfully from html pages. Please also let me know any implementation specific suggestions (like creation of a seperate login page for html application which will act like a middleware taking the session variable from php and converting it into html (session) variable or something like that, so that my html applications can use it.

Thanks.
May 11 '09 #1
3 2743
Dormilich
8,658 Expert Mod 8TB
what do you consider "HTML application"? HTML is just a bunch of static mark-up, which is rendered by the browser.

on the other hand side, PHP only works on the server (and is finished before anything reaches the browser), HTML only on the client, so you just need to print out in PHP to get it in HTML (but if this can be considered secure is more than questionable).
May 11 '09 #2
clain
79
the options are..

renaming the html files to php and passing the session varilables through out the page.

other option is calling a hidden iframe which holds a php session control page [its really a dirty idea]

next option is a javascript that can communicate with php server page with ajax [this is too much complicated yet effective ]
May 18 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Anthony Davis | last post by:
Hello all, Can someone please tell me if there is a way to declare variables within a class that can be shared among each new object created from this class? For instance I have the following: ...
5
by: MK | last post by:
Dear friends, I have many HTML files and they all have some common HTML code which is basically bunch of tags which are in all the files. How can I put the common code in one file and then share...
2
by: Bonj | last post by:
H I've got the following problem - I need to have an aspx page with two frames, although the question isn't necessarily about the workings of the frames, more session variables... the frames consist...
1
by: .NET Follower | last post by:
hi, i want to session state among different webprojects in my solution... any one has the solution...... -- Thanks and Regards, Amit Agarwal
6
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to...
8
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to...
5
by: Richard K | last post by:
Is it possible to share a single source file among two or more Projects in a Solution? I'm not talking about a DLL, just a .vb file that might contain a class or module with common code to be...
6
by: Gregory Gadow | last post by:
In a VB.Net 2.0 project, I have a WizardClass that contains a List (of RuleClass). Each rule needs access to variables within it's parent wizard, so the constructor for RuleClass is New (ByVal...
6
by: Immortal Nephi | last post by:
First class is the base class. It has two data: m_Base1 and m_Base2. Second class and third class are derived classes and they are derived from first class. m_Base1 and m_Base2 are inherited into...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.