Forums
This topic is locked
Converting ASP to PHP
Posted 17 Jul 2006 18:07:02
1
has voted
17 Jul 2006 18:07:02 Nyasha Muchena posted:
Hi would you please help me convert this code to PHP.Thanks i need this urgently<%
Dim studentNumber, strCon, con, rec
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("results.mdb"
studentNumber= trim(request.form("txtStudentNumber")
if studentNumber="" or not isnumeric(studentNumber) then
response.redirect "index.htm"
end if
Set con = server.createobject("adodb.connection"
con.open strCon
set rec = con.execute("SELECT StudentNumber from tblStudents where StudentNumber='"& studentNumber &"';"
if NOT rec.eof then
session("StudentNumber" = rec("StudentNumber"
else
Response.Redirect "index.htm"
end if
rec.close
set rec = nothing
%>