?
Solved

Oracle Session Management

Posted on 2003-12-09
2
Medium Priority
?
994 Views
Last Modified: 2013-12-03
Hi Forum,

I'm using PHP 4.3.4 to connect to Oracle 9i Release 2.

I'm able to connect to the DB and work with the DB.

My problem is when I need to maintain the same session across pages.

For eg., in Page1.php, I logged into the DB and retrieved some data.From Page1.php the next possible step is to move to Page2.php to do some operations,again,on the DB.

I wanted to use the same connection I have in Page1.php and not log into the DB again in Page2.php.

BTW,Page2.php is opened when a link in Page1.php is clicked !!!

Is there a way of doing it?

Thanks a ton for your inputs ...it's my first tryst with PHP !!!
0
Comment
Question by:catchmeifuwant
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
Rayni earned 1000 total points
ID: 9907639
Make a connetion script. For example make a new script called oracle_db.php this is where all your oracle connection. Then use the require function in your Page1.php & Page2.php scripts so that they each connect to the database.

require ( ' ./oracle_db.php ' );

I dont think you can make the same connection to the DB in Page1.php as you want to in Page2.php without being connected to the database. If you just wanted to obtain some information that Page1.php returns then either use cookies or sessions to obtain this information.

Page1.php w/ cookies :
// Using Cookies
setcookie ("username", $db[username]);
setcookie ("password", $db[password]);

Page1.php w/ sessions :
// Using Sessions
session_register("username");
session_register("password");

Page2.php
echo $username; // Print outs cookies or session variable username

Hope this help you.
- Daniel
0
 
LVL 12

Author Comment

by:catchmeifuwant
ID: 9918339
Hi Rayni,

Thanks a ton for the comments.It worked !!!

Cheers !!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question