|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
help with converting ASP to PHP
this is my asp script i need to convert it to php. please help.
Code:
For Each sForm in Request.Form
field1 = sForm
content = Server.HTMLEncode( Request.Form(sForm) )
pagename = replace(Request.Form("pagename"), "'", "''")
content = replace(Request.Form("EditorDefault"), "'", "''")
id = Request.Querystring("id")
dim query
if id <> "0" then 'UPDATE a page
query = "UPDATE tblpages SET content = '" & content & "', pagename = '" & pagename & "' WHERE ID = " & id
else
query = "INSERT INTO tblpages (content,pagename) VALUES ('" & content & "','" & content & "')"
end if
dim conn
set conn = getConn()
conn.execute(query)
conn.close()
set conn = nothing
response.redirect("../../master.asp")
Next
just use this for the mysql connection string (for now i can change this myself later) PHP Code:
|
|
#2
|
||||
|
||||
|
There's a nifty little tool out there calle asp2php. I'm not sure how reliable it is for large code sets, but it'd probably do the trick for something like this.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
Quote:
cheers. i ended up getting it to work in the end. but thanks for the suggestion. aron. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > help with converting ASP to PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|