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
Solved

How to invoke HttpUnit from php code?

Posted on 2006-11-20
4
699 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 82
how to see all occupied ports on windows 10 laptop 15 76
hibernate jars 4 45
jsp login check 12 42
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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.

860 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