Solved

How to invoke HttpUnit from php code?

Posted on 2006-11-20
4
667 Views
Last Modified: 2006-11-23
I have a site, UrlAudit.com it takes a list of URL and scans them to detect things like, Popups, frame breakers, viruses, etc

We are trying to increase the functionality and the accuracy of the system.  We have installed HttpUnit, however, our programmer has read the dcumentation at http://httpunit.sourceforge.net/, but he says he can't figure out how to invoke HttpUnit with our scripts.

Question is:

How can we call HttpUnit from our PHP script to scan the lists of urls?
0
Comment
Question by:GodadoLLC
  • 2
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 100 total points
ID: 17985533
You wouldn't so much invoke HttpUnit, but a Java program that uses it. Something like

$command = "$path_to_java $classpath $fq_classname_of_java_app_using_httpunit";
$output = shell_exec("$command");
0
 
LVL 6

Accepted Solution

by:
SamsonChung earned 400 total points
ID: 17991100
just simply

<?php
$returned = exec("java $httpUnitName");

?>

if you are on a linux/unix system, you can also modulized the system by writing a shell script that calls the java app
and have php call that shell script.

so you can simply run the shell script to see if it is working or not.

remember, exec ("blah"); means blah is simply a shell/dos command. so it takes in arguments too.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18003082
:-)
0
 
LVL 6

Expert Comment

by:SamsonChung
ID: 18003105
%:^)

Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now