PHP and JAVA

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tiborv
Forum Newbie
Posts: 11
Joined: Wed May 11, 2005 1:11 am

PHP and JAVA

Post by tiborv »

Hello !

I put this lines in index.tpl, and .js skripts are in subfolder /javascript. This javascript script is called index.js.

This script is for browsing and editing web content or web server...

When you browse the content of the server in web browser, there is a checkbox beside, and now i want to :

You have a file displayed in browser called test.php and beside is a checkbox. Now i want to check it and press the button, and that onclik do rsync -avu ('/www/test/* /www/test2/'); (just for the checked file)

I added this, but i donst know how to go further. When checbox is checked, the <input type="visible" name="file" value="" /> dispays it in the textbox. but how to do: on click check the checkbox and rsync the checked file or folder.

Code: Select all

&lt;table class=&quote;main_table&quote; cellpadding=&quote;2&quote; cellspacing=&quote;1&quote;&gt;
    &lt;tr&gt;
        &lt;th class=&quote;header_cell&quote;&gt;{SYNC_COMP}&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quote;task_cell&quote;&gt;
      &lt;form action=&quote;{THIS}&quote; method=&quote;post&quote; name=&quote;zip&quote;&gt;
      &lt;input type=&quote;visible&quote; name=&quote;dir&quote; value=&quote;{NEXT_DIR}&quote; /&gt;
      &lt;input type=&quote;visible&quote; name=&quote;op&quote; value=&quote;sync&quote; /&gt;
      &lt;input type=&quote;visible&quote;  name=&quote;folder&quote; value=&quote;&quote; /&gt;
      &lt;input type=&quote;visible&quote; name=&quote;file&quote; value=&quote;&quote; /&gt;
        &lt;table border=&quote;0&quote; width=&quote;100%&quote; cellpadding=&quote;4&quote;&gt;
                &lt;td align=&quote;right&quote; valign=&quote;bottom&quote; rowspan=&quote;2&quote;&gt;&lt;input type=&quote;submit&quote; onclick=&quote;JavaScript:return check();&quote; value=&quote;{SYNC}&quote; /&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
        &lt;/form&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

feyd | Please review how to post code using

Code: Select all

and

Code: Select all

tags. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

I'm not really sure of what you are talking about as you really didn't say what you wanted technically.
However, you do need to submit the form to make something happen, thus reload the page or a hidden frame... eitherway, nothing can be done without doing so.

Hope that helps.
tiborv
Forum Newbie
Posts: 11
Joined: Wed May 11, 2005 1:11 am

Post by tiborv »

When file is checked, i want to press the button sync, and then the file is synchronize ... I know the command to sync, but i dont know how to sync the checked file.
I read that must me somethink like :

<?php
exec ('rsync -avu $checkedfile/* /folder/where/you/synchronize/');
?>

And i dont know what is the command to show if it is synchronize or not.
Maybe IF, i dont know ...

There are hidden fields ...
Post Reply