Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 3rd, 2005, 09:51 AM
Authorized User
 
Join Date: May 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP to php

can anyone convert this asp to a php file?

myxml.asp


<%@ Language=VBScript %>
<%
Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fsoObject, fileName, filTextStream, strName, strEmail, strMessage, strDate, strData, strOldData, x, filepath
Dim process
'Get Path of Current ASP file
filepath = Server.MapPath("myxml.asp")
'Use The Path
filepath = left(filepath, len(filepath) - 9)

Set fsoObject = Server.CreateObject("Scripting.FileSystemObject")
Set fileName = fsoObject.GetFile(filepath & "myxml.xml")
Set filTextStream = fileName.OpenAsTextStream(ForReading, TristateFalse)

strOldData = filTextStream.ReadAll
x = len(strOldData) - 13

strData = Mid(strOldData, 1, x)
'Response.Write strData
filTextStream.close
Set filTextStream = fileName.OpenAsTextStream(ForWriting, TristateFalse)
strDate = Date
strName = Request.Form("strName")
strEmail = Request.Form("strEmail")
strMessage = Request.Form("strMessage")

'strData = Mid(strData, 32)
strData = strData & vbcrlf & "<entry>" & vbcrlf
strData = strData & "<date>" & strDate & "</date>" & vbcrlf
strData = strData & "<name>" & strName & "</name>" & vbcrlf
strData = strData & "<email>" & strEmail & "</email>" & vbcrlf
strData = strData & "<message>" & strMessage & "</message>" & vbcrlf
strData = strData & "</entry>" & vbcrlf
strData = strData & "</sqltable>"


filTextStream.Write strData
filTextStream.close

Set fsoObject = nothing
set fileName = nothing
set filTextStream = nothing
process = true
Response.Expires = 0

If process = true then
    Response.Redirect "index.html"
End If


%>


 
Old June 14th, 2005, 03:30 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: York, , United Kingdom.
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Try going to http://asp2php.naken.cc/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp/ PHP explore_asp Classic ASP Professional 4 February 23rd, 2013 04:16 AM
Asp.net v php Ducca571 ASP.NET 2.0 Professional 3 October 23rd, 2006 11:07 AM
ASP.NET vs. PHP Aaron Edwards ASP.NET 2.0 Basics 0 May 6th, 2006 12:51 PM
ASP.NET and PHP Prabhakar_dt VB Components 0 September 9th, 2005 04:44 AM
php to asp simflex Classic ASP Professional 2 June 10th, 2004 11:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.