Re: ASP to PHP

From: Date: Sun, 13 Apr 2003 13:43:42 +0000
Subject: Re: ASP to PHP
Groups: php.general 
Request: Send a blank email to php-general+get-143665@lists.php.net to get a copy of this message
Thanks for the offer Roman, I have a project I need to complete - but I'm going to take it as a challenge and use PHP instead of ASP to see how much I can learn. Obviously, I'd appreciate as much help as I can over the next few weeks. Cheers Tim ----- Original Message ----- From: Roman Belonohý To: Tim Burgan Sent: Sunday, April 13, 2003 8:30 PM Subject: RE: [PHP] ASP to PHP Hi Tim, I can convert it for you if you want. Roman > -----Original Message----- > From: Tim Burgan [mailto:burgan@iprimus.com.au] > Sent: Sunday, April 13, 2003 6:51 AM > To: PHP Lists > 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 (#143665) next »