?
Solved

How to invoke HttpUnit from php code?

Posted on 2006-11-20
4
Medium Priority
?
716 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 400 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 1600 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses
Course of the Month8 days, 12 hours left to enroll

764 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