ASP --> PHP
Posted: Fri Sep 02, 2005 12:36 pm
I've the following code in ASP and I want to convert it to PHP but not quite know how. Could someone good with PHP and ASP show me how? Thanks...
Code: Select all
<%
dim tmpcity
dim tmpcity
if Request.Form("hidCity") <> "" then
tmpcity= Request.Form("hidCity")
else
tmpcity=0
end if
%>
<SCRIPT LANGUAGE=javascript>
function selcity(obj)
{
document.getElementById("hidCity").value=obj.options[obj.options.selectedIndex].value
if(document.getElementById("hidCity").value!=0)
{
document.getElementById ("frmcity").submit()
}
}
</SCRIPT>
<form name="frmcity" id="frmcity" method="post" action="findapub.asp">
<input type="hidden" name="hidCity" id="hidCity" value="<%= tmpcity%>">
</form>
<form id="frmnew" name="frmnew" method="post" action="publist.asp">
City:-
<%
dim rscity
set rscity = GetRecordSet("SELECT * FROM Cities order by cityname")
%>
<select name="dropbox3" ID="SelectCity" onchange="javascript:selcity(this)">
<option value="">Select a City</option>
<%while not rscity.EOF %>
<option value="<%= rscity("cityid")%>" <%if cint(tmpcity) = cint(rscity("cityid")) then%> selected <%end if%>><%= rscity("cityname")%>
</option>
<%rscity.movenext : wend%>
</select>
Area-
<%
dim rsarea
set rsarea = GetRecordSet("SELECT Areas.areaid, Areas.City, Areas.Area FROM Areas WHERE Areas.City=" & tmpcity)
%>
<select NAME="dropbox">
<option value="Area0">Any</option>
<%while not rsarea.eof%>
<option value="<%= rsarea("areaid")%>"><%= rsarea("Area")%></option>
<%rsarea.movenext : wend%>
</select>