<?php
/**
*
* PHP example
*
*/
header('Content-type: text/vnd.curl');
// All of the above code is PHP.
// What follows the next line (i.e., after "echo <<<END") is Curl code.
echo <<<END
{curl 5.0 applet}
{value
{Frame
width = 5cm,
height = 5cm,
border-color = "gray",
border-width = 0.1cm,
border-style = "raised",
background = "#4578ef",
{hcenter
{vcenter
"A PHP script on the server generated this applet."
}
}
}
}
END;
// The Curl code ended before the previous line (i.e., before "END;").
?>
<A HREF="dynamic-applet.asp?"> Generate Curl content from an asp file</A>
<%@ LANGUAGE=vbscript%>
<% Response.ContentType = "text/vnd.curl" %>
{curl 5.0 applet}
{value
{Frame
width = 5cm,
height = 5cm,
border-color = "gray",
border-width = 0.1cm,
border-style = "raised",
background = "#4578ef",
{hcenter
{vcenter
"An ASP script on the server generated this applet."
}
}
}
}
<?php
// Include any supporting PHP code.
include("supporting-php-code.php");
// Set the Curl MIME type
header('Content-type: text/vnd.curl');
// Set a variable using your PHP code.
$variable = getUsername();
// All of the above code is PHP.
// What follows the next line (i.e., after "echo <<<END") is Curl code.
echo <<<END
{curl 5.0 applet}
{value
{Frame
width = 5cm,
height = 5cm,
border-color = "gray",
border-width = 0.1cm,
border-style = "raised",
background = "#4578ef",
{hcenter
{vcenter
"Hello " & "$variable" & "!"
}
}
}
}
END;
// The Curl code ended before the previous line (i.e., before "END;").
?>
}
<?php
function getUsername() {
return "Curl User";
}
?>
<%@ LANGUAGE=vbscript%>
<% Response.ContentType = "text/vnd.curl" %>
<% variable= getUsername() %>
{curl 5.0 applet}
{value
{Frame
width = 5cm,
height = 5cm,
border-color = "gray",
border-width = 0.1cm,
border-style = "raised",
background = "#4578ef",
{hcenter
{vcenter
"Hello " & "<% =variable%>" & "!"
}
}
}
}
End of Curl content.
![]() |
Other ways to run Curl applets...
|
There are no comments on this document