Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    small site from asp to php

    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:
    Code:
    <%
    h=<ID of accommodation>
    %>
    <!--#include file="../inc/hotelpage.asp"-->

    hotelpage.asp begins with this code:
    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
    Last edited by Yaelede; 09-15-2011 at 02:51 PM. Reason: specifying the question

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Quote Originally Posted by Yaelede View Post
    Code:
    <!--#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:
    PHP Code:
    $cr $_POST['cr']; 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •