[PHP] calling java within php setup?
I'm trying to call java within php. I have JAVA JRE 1.6 installed. The php I'm using is distributed by our partner so I couldn't configure it to use JAVA. I've modified the "php.ini" file to add the JRE path to it: java.class.path="/usr/java/jre1.6.0_01" java.home="/usr/java/jre1.6.0_01/bin" java.library.path="/usr/java/jre1.6.0_01/lib" I've wrote a Basic java within php, but I get error: "Fatal error: Class 'Java' not found. What am I missing? Can I import java in php? Below is the java part: getProperty('java.version') . ''; echo 'Java vendor=' . $system->getProperty('java.vendor') . ''; echo 'OS=' . $system->getProperty('os.name') . ' ' . $system->getProperty('os.version') . ' on ' . $system->getProperty('os.arch') . ' '; // java.util.Date example $formatter = new Java('java.text.SimpleDateFormat', ", dd, 'at' h:mm:ss a "); echo $formatter->format(new Java('java.util.Date')); ?>
Re: [PHP] calling java within php setup?
Hi Richard, They didn't installed PECL. Is there a way to installed just PECL and not overwrite their php configuration? I noticed when I went to the PECL link I didn't see a PECL package download, but I had to search for packages I wanted to install, what am I looking for? Thanks! On Jan 15, 2008 11:36 AM, Richard Lynch <[EMAIL PROTECTED]> wrote: > On Tue, January 15, 2008 12:39 pm, Janet N wrote: > > I'm trying to call java within php. I have JAVA JRE 1.6 installed. > > The php > > I'm using is distributed by our partner so I couldn't configure it to > > use > > JAVA. > > Modifying php.ini doesn't get the Java extension installed. > > They have to PECL install Java extension for it to work. > > You'll know if they have done that by checking > output. It either mentions Java, and it's installed; or it doesn't, > and it's not. > > > > // get instance of Java class java.lang.System in PHP > > $system = new Java('java.lang.System'); > > You don't have that class to instantiate, because you don't have the > extension installed. > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/from/lynch > Yeah, I get a buck. So? > >
[PHP] php embeded in html after first submit html disappear
Hi there, I have two forms on the same php page. Both forms has php embeded inside html with it's own submit button. How do I keep the second form from not disappearing when I click submit on the first form? My issue is that when I click the submit button from the first form (register), the second form (signkey) disappear. Code below, any feedback is appreciated: $shell_lic"; } } ?> Enter the domain name: $shell_createDK"); } } ?>
Re: [PHP] calling java within php setup?
I have root; I was able to compile php with java and working now. Thanks all! On Jan 16, 2008 4:06 PM, Richard Lynch <[EMAIL PROTECTED]> wrote: > On Tue, January 15, 2008 5:32 pm, Jochem Maas wrote: > > Janet N schreef: > > with a bit of luck you'll then have a .so file that is your new > > extension, > > now it a matter moving the .so to a suitable place (if you have root > > access, you > > can run 'make install') and of editing php.ini to load the extension. > > If you don't have root, you probably can't move it to the suitable place. > > Otherwise, any bozo could install and .so file into the PHP binary, > which could do anything at all to the PHP process, including hack all > kinds of nasty functions to, say, dump ALL incoming GET/POST data > whose variable name looks like "*cc*" or "*credit*" or "*card*" out to > some email address... > > That said, if your host is a bit lax in security, you might be able to > use DL to LOAD your .so file into your script: > http://php.net/dl > > Note that 'dl' is probably going away in PHP 6, last I heard. > > -- > Some people have a "gift" link here. > Know what I want? > I want you to buy a CD from some indie artist. > http://cdbaby.com/from/lynch > Yeah, I get a buck. So? > >
Re: [PHP] php embeded in html after first submit html disappear
is it possible to use "input type="hidden" for signkey form and put it in the register form before the submit button? I'm not sure but is it possible to use hidden to make this work? Thanks. On Jan 30, 2008 3:16 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Janet N schreef: > > Hi there, > > > > I have two forms on the same php page. Both forms has php embeded > inside > > html with it's own submit button. > > > > How do I keep the second form from not disappearing when I click submit > on > > the first form? My issue is that when I click the submit button from > the > > first > > form (register), the second form (signkey) disappear. Code below, any > > feedback is appreciated: > > we the users clicks submit the form is submitted and a new page is > returned. nothing > you can do about that (unless you go the AJAX route, but my guess is > that's a little > out of your league given your question). > > why not just use a single form that they can fill in, nothing in the logic > seems to require that they are seperate forms. > > BTW your not validating or cleaning your request data. what happens when I > submit > $_POST['domain'] with the following value? > > 'mydomain.com ; cd / ; rm -rf' > > PS - I wouldn't try that $_POST['domain'] value. > PPS - font tags are so 1995 > > > > > > > > > > > > > > if (isset($_POST['register'])) > > { > >$register = $_POST['register']; > > } > > if (isset($register)) > > { > >$filename = '/usr/local/register.sh'; > >if(file_exists($filename)) > >{ > >$command = "/usr/local/register.sh "; > >$shell_lic = shell_exec($command); > > echo "$shell_lic"; > >} > > } > > ?> > > > > > > > > > >> domain="label">Enter the domain name: > > name="makesignkey" > > value="Submit" > > > > > if (isset($_POST['makesignkey'])) > > { > > $makesignkey = $_POST['makesignkey']; > > } > > if (isset($makesignkey)) > > { > > if(isset($_POST['domain'])) > > { > > $filename = '/usr/local//keys/generatekeys'; > > if(file_exists($filename)) > > { > > $domain = $_POST['domain']; > > $command = "/usr/local/keys/generatekeys " . $domain; > > > > $shell_createDK = shell_exec($command); > > print(" > color=blue>$shell_createDK"); > > } > > } > > ?> > > > > > >
Re: [PHP] php embeded in html after first submit html disappear
Hi Jochem, Thanks for the prompt response. No I do not want people to fill in both forms at once. I actually have a three step process. I simplified it to two because if I can get two steps to work, I should be good to go. Each step depends on the preceding step having completed successfully. Users therefore need a success message after each step is successfully completed. We cannot require that users do all steps in one sitting. It must be possible to do step one, leave, come back the next day and do 2,etc. Because there is not enough to each step to justify a full web page devoted to it alone, I have decided to keep all steps on one page. Is there any way to use the "hidden" attribute of HTML variables to prevent the output message from overwriting the page? On Jan 30, 2008 5:30 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Janet N schreef: > > is it possible to use "input type="hidden" for signkey form and put it > in > > the register form before the submit button? I'm not sure but > > is it possible to use hidden to make this work? > > what are you trying to do? do you want to have people fill in both forms > at once then process them serially (i.e. in 2 different requests) ... > if so then break up the forms in to 2 pages ... if not I can't figure out > what you want to do at all. please explain. > > > > > Thanks. > > > > On Jan 30, 2008 3:16 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: > > > >> Janet N schreef: > >>> Hi there, > >>> > >>> I have two forms on the same php page. Both forms has php embeded > >> inside > >>> html with it's own submit button. > >>> > >>> How do I keep the second form from not disappearing when I click > submit > >> on > >>> the first form? My issue is that when I click the submit button from > >> the > >>> first > >>> form (register), the second form (signkey) disappear. Code below, any > >>> feedback is appreciated: > >> we the users clicks submit the form is submitted and a new page is > >> returned. nothing > >> you can do about that (unless you go the AJAX route, but my guess is > >> that's a little > >> out of your league given your question). > >> > >> why not just use a single form that they can fill in, nothing in the > logic > >> seems to require that they are seperate forms. > >> > >> BTW your not validating or cleaning your request data. what happens > when I > >> submit > >> $_POST['domain'] with the following value? > >> > >> 'mydomain.com ; cd / ; rm -rf' > >> > >> PS - I wouldn't try that $_POST['domain'] value. > >> PPS - font tags are so 1995 > >> > >>> > >>> > >>> > >>> > >>> >>> if (isset($_POST['register'])) > >>> { > >>>$register = $_POST['register']; > >>> } > >>> if (isset($register)) > >>> { > >>>$filename = '/usr/local/register.sh'; > >>>if(file_exists($filename)) > >>>{ > >>>$command = "/usr/local/register.sh "; > >>>$shell_lic = shell_exec($command); > >>> echo "$shell_lic"; > >>>} > >>> } > >>> ?> > >>> > >>> > >>> > >>> > >>>>>> domain="label">Enter the domain name: > >>> >> name="makesignkey" > >>> value="Submit" > >>> > >>> >>> if (isset($_POST['makesignkey'])) > >>> { > >>> $makesignkey = $_POST['makesignkey']; > >>> } > >>> if (isset($makesignkey)) > >>> { > >>> if(isset($_POST['domain'])) > >>> { > >>> $filename = '/usr/local//keys/generatekeys'; > >>> if(file_exists($filename)) > >>> { > >>> $domain = $_POST['domain']; > >>> $command = "/usr/local/keys/generatekeys " . $domain; > >>> > >>> $shell_createDK = shell_exec($command); > >>> print(" >>> color=blue>$shell_createDK"); > >>> } > >>> } > >>> ?> > >>> > >>> > >> > > > >