Jump to content

ASP to PHP


lbh2011

Recommended Posts

Hi everyone!

 

I’ve been given a website coded in ASP which I would prefer to be coded in PHP so that I can make more sense of it!

I can’t work out how to convert this section of site which I believe is placed at the top of each file to login the admin user and set the user session.

 

Would someone be able to provide me with a rough translation!?

 

Thanks!

 

<!--#include virtual="connections/conn.asp" -->
<%
if request.form("send") = "yes" then
varuser = request.form("user")
varpass = request.form("pass")

set rslogin = conn.execute("select * from security where sec_user = '" & varuser & "' and sec_pass = '" & varpass & "'")
if rslogin.eof then
varmsg = "There was a problem with your login details, please try again."
elseif not rslogin.eof then
session.timeout = 120
session("logged") = "admin"
response.redirect("home.asp")
end if
rslogin.close()
set rslogin = nothing
end if
%>

Link to comment
https://forums.phpfreaks.com/topic/272743-asp-to-php/
Share on other sites

Really? I need to write this for you?

 

Where exactly are you stuck? It's a very simple script.

 

Instead of checking eof, just check the count of your results. eg; mysql_num_rows() to see if you have found a match with your query.

 

It really is a very simple login script. I'd simply forget the asp, and write your own in php. It's not like it's a particularly well written example of asp anyway.

Link to comment
https://forums.phpfreaks.com/topic/272743-asp-to-php/#findComment-1403519
Share on other sites

I’ve been given a website coded in ASP which I would prefer to be coded in PHP so that I can make more sense of it!

If all you want is to learn what it does then it's easier to just learn (to read) ASP than to try to transcode everything into PHP. Classic ASP is written in Visual Basic: practically the easiest language to read ever invented. I mean heck, just look at it and take a guess based on the names of things.

 

[edit] Besides, as trq mentioned, it's a horrible script anyways.

Link to comment
https://forums.phpfreaks.com/topic/272743-asp-to-php/#findComment-1403589
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.