Re: ASP to PHP

From: Date: Sun, 13 Apr 2003 05:32:49 +0000
Subject: Re: ASP to PHP
Groups: php.general 
Request: Send a blank email to php-general+get-143640@lists.php.net to get a copy of this message
http://www.php.net/manual/en/faq.php -----Original Message----- From: Tim Burgan <burgan@iprimus.com.au> To: PHP Lists <php-general@lists.php.net> Date: Saturday, April 12, 2003 11:59 PM Subject: [PHP] ASP to PHP >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> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#143640) next »