ASP to PHP
| From: | Tim Burgan | Date: | Sun, 13 Apr 2003 04:50:58 +0000 |
| Subject: | ASP to PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-143637@lists.php.net to get a copy of this message | ||
Here is some code in ASP that I want to convert to PHP.
I honestly have no idea about much of PHP yet so I don't know where to start
with this.
If someone has a minute, can you please get me started til I get my head
around the language
Cheers
----------ASP Code------------------------
<%
' Declare Variables
Dim MoveFile, strUserName, strPath
' Collect UserName from Form input
strUserName = Request.Form("UserName")
If Len(strUserName) = 0 Then
' no UserName entered
'Sub NoUserName ()
Response.Write("Please <b>re-enter</b> your UserName")
'End Sub
End If
' Check to see if folder already exists
strPath = "C:\inetpub\wwwroot\" & strUserName
Set MoveFile = CreateObject("Scripting.FileSystemObject")
' If folder doesn't exist, create it & move file
If Not MoveFile.FolderExists(strPath) Then
MoveFile.CreateFolder(strPath)
MoveFile.CopyFile "C:\inetpub\wwwroot\templates\referred.htm", strPath &
"\index.htm"
'Response.Redirect strPath & "\index.htm"
Else
' UserName already exists
Sub UserNameExists ()
Response.Write("The Username you have selected <b>already exists</b>.
Please try again")
End Sub
End If
SET MoveFile = Nothing
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Enter your username</title>
</head>
<body>
<%
' Call NoUserName
' Call UserNameExists
%>
<form name="frmSelectUsername" action="move-files.asp"
method="post">
Please <b>enter a Username</b> that you want to use<br>
<input type="text" name="UserName" size="20">
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>