473,800 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to Share variables among php and html

3 New Member
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 2763
Dormilich
8,658 Recognized Expert Moderator Expert
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 New Member
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
prabirchoudhury
162 New Member
read those basic posts, thereds and online tutorials


Pass data to another page?

Pass data to another page?

html form submit in php

php $_post, $_get and $_request
May 18 '09 #4

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

Similar topics

3
3736
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: class DB { var $db; var $host; var $un;
5
7588
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 it in all the files? It is some thing like following in all the HTML files which I have. <HTML> <HEAD> Common </HEAD> <BODY>
2
2131
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 of one header (not resizable) and one main (resizable). The source for the "main" page needs to be of the form "WebForm3.aspx?...." with parameters to be determined at runtime. I'm ok with this, I've gone down the route of puttin src="<%=...
1
319
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
1622
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 explain.) The simple version of the system is like this : A customer inserts HTML code on his webpage, which contacts my statistics server each time the customers website recieves a hit - like a classic "register website traffic" system. ...
8
4556
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 explain.) The simple version of the system is like this : A customer inserts HTML code on his webpage, which contacts my statistics server each time the customers website recieves a hit - like a classic "register website traffic" system. ...
5
2051
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 compiled into each project. That way this code can be updated once instead of makiing duplicate changes to identical code within each project. I have tried putting the source in a common folder, then using Add Existing Item to add it to each...
6
1080
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 Wizard as WizardClass). Each rule then has a property Private Wiz as WizardClass, which is set in Sub New with Wiz = Wizard. Currently there is only one Wizard in the project but there might be more in the future to handle different rulesets. My...
6
2182
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 two derived classes. Second class has its own m_Base1 and m_Base2 and third class does the same. I am curious. How can second class and third class share the same m_Base1 and m_Base2? You define second class first and enter data into...
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.