Dalziel
07-02-2003, 12:16 AM
I know a reasonable amount of PHP but I don't know where to start with ASP, a friend wants me to build a site for them and it will be running on a server with ASP and no PHP, the server side code is only very basic and I'm sure ASP can do what PHP does, if someone could tell me how to convert the script below (which I just wrote as an example) I can do everything I want
<?php
$name = "Your Name";
$address = "32 High Street";
$uppername = strtoupper($name);
if (isset($name)
{
echo "The variable name is set as $name";
}
include("header.php");
echo "Hi $name of $address how are you today.";
?>
Thanks :thumbsup:
Morgoth
07-02-2003, 04:23 AM
' = Comment
<%
Function PCase(strInput)
Dim iPosition ' Our current position in the string (First character = 1)
Dim iSpace ' The position of the next space after our iPosition
Dim strOutput ' Our temporary string used to build the function's output
iPosition = 1
Do While InStr(iPosition, strInput, " ", 1) <> 0
iSpace = InStr(iPosition, strInput, " ", 1)
strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, iPosition + 1, iSpace - iPosition))
iPosition = iSpace + 1
Loop
strOutput = strOutput & UCase(Mid(strInput, iPosition, 1))
strOutput = strOutput & LCase(Mid(strInput, iPosition + 1))
PCase = strOutput
End Function
Dim StrName, StrAddress, StrUpperName
'THIS IS NOT NEEDED; It dimentions memory. Str is just a prefix, it's not necassary.
StrName = "yOUr nAMe"
StrAddress = "32 High Street"
StrUpperName = PCase(StrName)
'Uses the function above.
Response.Write StrUpperName
'Just letting you view the results.
If StrName <> "" Then
Response.Write "The variable name is set as " & StrName & "<br>"
End If
'(=Equal To) (>Greater Than) (<Less Than) (<>Not Equal To) (>=Greater Than OR Equal To) (<=Less Than OR Equal To)
%>
<!--#INCLUDE FILE="header.php" --><br>
<!--Not part of ASP Code-->
<%
Response.Write "Hi " & StrName & " of " & StrAddress & ".<br>How are you today?"
%>
Here's what you get from the code above.
http://24.226.62.28/-/Dalziel.asp
Header.php:
Header! PHP can't be ran like this.
Thanks http://aspfree.com/authors/Chad_Scarborough/propercase.asp, for the ProperCase Function.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.