Answered
Need to retrieve the actual text of a URL and store to a variable
Looking for some advice here, I can do this in PHP but I'm
too new to CF to know it yet. To pass from PHP to CF would mean
sending these variables back through the web URL which I want to
avoid.
Basically I have a precompiled java module that I have to use that returns a Y or N to verify authentication.
I need to create the following scenerio:
Display Form with username and password;
Capture username as UserID and password as Password
Retrieve Y or N from the screen from URL http:/intranet/servlet/WebLogin?UserID=XXX&Password=YYY
Store verification result as a global variable
My attempt at CF:
<cfform name="loginform" action="http:/intranet/servlet/WebLogin"
method="Get">
<table>
<tr>
<td>username:</td>
<td><cfinput type="text" name="UserID" required="yes"
message="A username is required"></td>
</tr>
<tr>
<td>password:</td>
<td><cfinput type="password" name="Password" required="yes"
message="A password is required"></td>
</tr>
</table>
<br>
<input type="submit" value="Log In">
</cfform>
--This code works to redirect the screen the URL displaying Y or N, but how I can't grab the result and store it =(
:My PHP code to do this (works completely)
<?PHP
$url = 'http:/intranet/servlet/WebLogin?UserID=XXX&Password=YYY';
$html = file_get_contents($url);
if(preg_match('/Y/', $html, $matches))
{
echo "success";
}
else
{
echo "no success";
}
?>
Thanks all
Basically I have a precompiled java module that I have to use that returns a Y or N to verify authentication.
I need to create the following scenerio:
Display Form with username and password;
Capture username as UserID and password as Password
Retrieve Y or N from the screen from URL http:/intranet/servlet/WebLogin?UserID=XXX&Password=YYY
Store verification result as a global variable
My attempt at CF:
<cfform name="loginform" action="http:/intranet/servlet/WebLogin"
method="Get">
<table>
<tr>
<td>username:</td>
<td><cfinput type="text" name="UserID" required="yes"
message="A username is required"></td>
</tr>
<tr>
<td>password:</td>
<td><cfinput type="password" name="Password" required="yes"
message="A password is required"></td>
</tr>
</table>
<br>
<input type="submit" value="Log In">
</cfform>
--This code works to redirect the screen the URL displaying Y or N, but how I can't grab the result and store it =(
:My PHP code to do this (works completely)
<?PHP
$url = 'http:/intranet/servlet/WebLogin?UserID=XXX&Password=YYY';
$html = file_get_contents($url);
if(preg_match('/Y/', $html, $matches))
{
echo "success";
}
else
{
echo "no success";
}
?>
Thanks all