Jump to content

rabid lemming

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rabid lemming's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey ya all  ;D I am trying to convert to following asp.net code to php version. My php code which always says there is a phase error on line 2 "Parse error: parse error in c:\program files\easyphp1-8\www\index.php on line 2" even if I remove line 2 and 16, 17 & 18 [code] <?php try { $GetTheRegularExpressionString = $_POST['TheRegularExpression']; $GetTheStringToValidateString = $_POST['TheString']; if ((isset($GetTheRegularExpressionString) == true) && (isset($GetTheStringToValidateString) == true)) { if (preg_match($GetTheRegularExpressionString, $GetTheStringToValidateString) == true) { print "dat=true"; } else { print "dat=false"; } } else { print "dat=opps"; $URL="RegularExpressionsHTMLVersion.aspx"; header ("Location: $URL"); } } catch (Exception $exception) { print ("dat=" + $exception->getMessage()."\n".$error->getDebugInfo()); } ?> [/code] My asp.net code: [code] <%@ Import NameSpace="System" %> <%@ Import NameSpace="System.Net" %> <%@ Import NameSpace="System.IO" %> <%@ Import NameSpace="System.Text.RegularExpressions" %> <%@ Page Language="VB" Debug="true" validateRequest="false" AutoEventWireup="true" %> <script runat="server">     Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load         ' check page isn't been post back from form event procedures         Try             Dim GetTheRegularExpressionString As String = New String(Request.Form("TheRegularExpression"))             Dim GetTheStringToValidateString As String = New String(Request.Form("TheString"))             If GetTheRegularExpressionString.Length <> 0 And GetTheStringToValidateString.Length <> 0 Then                 Dim StringRegex As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(GetTheRegularExpressionString)                 If StringRegex.Match(GetTheStringToValidateString).Success = True Then                     Response.Write("dat=True")                 Else                     Response.Write("dat=False")                 End If             Else                 Response.Write("dat=False")                 Response.Redirect("RegularExpressionsHTMLVersion.aspx")             End If         Catch ex As Exception             Response.Write("dat=" & ex.ToString)         End Try     End Sub </script>[/code] Can any one tell me what I’m missing as far as i can see it all seams ok !?  ???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.