[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

A change from ASP to php.. sessions..Any ideas?

I have a project that I have to add another page to the site. However the site has been written in asp and uses ms sql server for the database. I use mysql. The problem is that the visitors have to login to the site first and then they can go to the different pages on the site. I do most of work in php and I know that we can use sessions to do it however how do I get the sessions from asp? when the people logged in, how can I keep what they entered as their login and password when they come to my page and the information is not lost.

Thanks
0
syedasimmeesaq
Asked:
syedasimmeesaq
  • 5
  • 4
  • 3
  • +1
5 Solutions
 
nplibCommented:
you can't.
either make the whole site php or asp.
using both is a developer nightmare
0
 
Muhammad WasifCommented:
You can generate some random number and save it in cookie and database using asp. When user click on php pages, get the values from cookie and compare it with the value in database. If the match is found, you can give access to the users.

Use of random number is just an idea, you can use combination of random number and email address or something else.
0
 
nplibCommented:
yes cookies can be created in any language and read in another
0
Independent Software Vendors: 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!

 
b0lsc0ttCommented:
There can be difficulties in reading cookies from one language to another.  The browser will have access to them and they can be read but sometimes you have to get the complete cookie and manually process it.  Also since the cookie is on the client side it is prone to more failure.

The best option is to use the database.  Are you migrating completely to MySQL for ASP and PHP?  The specifics can vary but the general idea Wasifg mentioned above will help.

You could also look at third party session management tools for your server.  I can't say for sure if there are some that will work in both languages but I believe so.  They are made to use the database to manage the session and if both languages can access the server and database then it should be possible.

If most of your site and session stuff will be in PHP now then I really recommend you consider getting rid of the ASP.  What is the point of it?  It will just add difficulty to what you want to do and make it more complex.  That just makes failures and issues more likely.

If you just had one, unimportant thing in PHP then I would say use cookies.  They will be easy and quick.  You just might have a little work to get PHP to read the ASP cookie.

If there will be a even mix of ASP and PHP using the session info then the database is your best option.  This of course assumes you will narrow down to one database.  I would recommend against using two, especially since both languages can access each of those databases.

I hope this helps.  Let me know if you have a question or need more info.

bol
0
 
syedasimmeesaqAuthor Commented:
I think I can use mssql. How do I setup pp so it can access mssql?
I know I can change php.ini but do I need soomething more than that, any special downloads for extensions and dlls?

Thanks
0
 
nplibCommented:
download php from php.net,
install,
make sure the extension php_mssql.dll is loaded in php.ini
0
 
syedasimmeesaqAuthor Commented:
I have already downloaded php. I think that there should be another file in system32 directory of the machine. It says to put that file in \winnt\sytem32. I dont have a winnt directory. I have Windows\system32 directory. Is that the same?
0
 
nplibCommented:
yes
0
 
syedasimmeesaqAuthor Commented:
I just copied ntwdblib.dll to windows\system32 directory and took out the comment ; and made sure extension=php_mssql.dll is in php.ini file. But when I ran phpinfo() it still doesn't show mssql
Thanks
0
 
b0lsc0ttCommented:
You might want to open a new question here for that new issue.  I can't help you specifically with it and no expert will know about this based on the question title and body above.  It really is a separate issue.

Do you have any more questions about this issue or need more info on it?

If you want to let the experts here know about the new question for the MSSQL setup issue then post the URL of the new question here.

bol
0
 
nplibCommented:
make a php page
<?php
$connect = mssql_connect("server", "user", "password") or die("it doesn't work");
if ($connect) {
   echo "WOO HOO";
}
?>

make sure server is the FQDN or ip address of your actual sql server, username is a user that has rights to logon and password, the real password.

0
 
syedasimmeesaqAuthor Commented:
As from the respected expert advice, you may help me at this post
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/Q_22989071.html
thanks
0
 
b0lsc0ttCommented:
Thanks!  I'm glad I could help.  Thanks for the grade, the points and the fun question.  I'll take a look at the other question and post if I can help.  However that isn't something I have really messed with in PHP. :)

See you around!

bol
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now