how about using ASP script instead
here is a simple example (with no error checking)
'Code start --------------------
<%
dim whattodo, sql_agent_status
sql_agent_status = "UNKNOWN"
whattodo = request.form("scriptaction")
if whattodo = "check" then
runscripta request.form("db_server"),request.form("db_pw"),"EXEC master..xp_servicecontrol 'QueryState', 'SQLServerAgent'"
elseif...