...

View Full Version : small site from asp to php



Yaelede
09-15-2011, 02:16 PM
I have an old asp site, and I'm in the process to convert it to PHP/MySql. It's a small regional accommodation site. I'm by far not a programmer, so I'm doing it using Dreamweaver. I could easily convert the list-type pages using DW, and only the individual accommodation pages remained.
There are two pages which I would like to convert.
These pages has been made not by me, and they were hard-coded.

Every accommodation has a separate file (I know it would be much better to make a PHP project, but it's really beyond my knowledge), and they all look like this:
mysite.com/hotel/hotelname.asp
and the code is:


<%
h=<ID of accommodation>
%>
<!--#include file="../inc/hotelpage.asp"-->



hotelpage.asp begins with this code:


<!--#include file="../include/global.lib"--> ' this file contains connection string, I can solve this
<%
cr = request.form("cr")

if h<1 then
h = request.querystring("h")
end if

if h = "" then
response.redirect "../find.asp"
end if

sql = "select * from hotel_table where hotelid ='" & h & "'"

dodb(sql)

if rs.eof or rs.bof then
response.write "Invalid access. Press the back button."
halt_rs = true
end if

if not halt_rs then

%>


I could solve the rest of this file.

Could anyone help me to convert the two above files?

Thank you
Yaelede

Inigoesdr
09-15-2011, 02:19 PM
<!--#include file="../include/global.lib"--> ' this file contains connection string, I can solve this
<%
cr = request.form("cr") ' actually I don't really know what this line is for


That is getting the value of a POSTed form variable called "cr" and setting it to a local variable. The equivalent code in PHP would look like this:


$cr = $_POST['cr'];



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum