PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old March 10th, 2004, 06:59 PM
aron aron is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brisbane
Posts: 42 aron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 9 m 35 sec
Reputation Power: 5
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:
 mysql_connect($server,$user,$password) or die("Database error");
mysql_select_db($database); 

Reply With Quote
  #2  
Old March 11th, 2004, 11:18 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
  #3  
Old March 11th, 2004, 04:48 PM
aron aron is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: brisbane
Posts: 42 aron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 9 m 35 sec
Reputation Power: 5
Quote:
Originally Posted by dhouston
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.



cheers. i ended up getting it to work in the end. but thanks for the suggestion.

aron.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > help with converting ASP to PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway