Jump to content


asp to php


1 reply to this topic

#1 ace4hire

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 19 July 2005 - 05:45 AM

can u guys help meh in converting this asp script to php...

nv_admin_login is inside adminfunctions.asp
<!--#include file="include/adminfunctions.asp"-->
<!--#include file="include/adminloginheader.asp"-->
<!-- END Main Header -->

<%
if request("submit_login") <> "" then

	response.cookies("nv_admin_login").Domain = "nationalvisas.com.au"
	response.cookies("nv_admin_login").Path = "/manage_dev"
	response.cookies("nv_admin_login").Secure = True
	response.cookies("nv_admin_login").Expires = "Jan 19, 2038"
	response.cookies("nv_admin_login")("username") = request("username")
	response.cookies("nv_admin_login")("password") = request("password")

	if doLogin() = true then
  response.redirect "search.asp"
	end if

	errMsg = "Login Unsuccessful"
end if
%>


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 20 July 2005 - 12:43 PM

<?
include "include/adminfunctions.asp";
include "include/adminloginheader.asp";
<!-- END Main Header -->

if($_POST['submit_login'] != ""){
// http://php.net/manual/en/function.setcookie.php
// Use the link above, i don't feel like doing this part.

setcookie();

/*
response.cookies("nv_admin_login").Domain = "nationalvisas.com.au"
response.cookies("nv_admin_login").Path = "/manage_dev"
response.cookies("nv_admin_login").Secure = True
response.cookies("nv_admin_login").Expires = "Jan 19, 2038"*/
$_COOKIE['username'] = $_POST['username'];
$_COOKIE['password'] = $_POST['password'];

if(doLogin()){
 header("Location: search.asp");
}

$errMsg = "Login Unsuccessful";
}
?>

Naturally, none of the asp pages will work when included, and will most likely end up in an error message. Also, you're going to have to look up the cookie thing your self, i just don't feel like rewirting that part. Simply add what you need where php.net says to put it in the setcookie(); that i added for you.

p.s. this script is assuming that you used a form with the POST method. If you used GET, then find a replace the POST's with GET





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users