www.webdeveloper.com
Results 1 to 4 of 4

Thread: configure HTMl (Urgent)

  1. #1
    Join Date
    Jun 2003
    Posts
    181

    configure HTMl (Urgent)

    Hi,
    i created 2 frames left frame is tree and second frame is when i click on any link on tree i will get following html pages on right frame

    and on tree there is submit button name configure html when i click on any link on left frame and then clcik on this button it will open a form on right side frame and there
    Relative path to directory or file:text field here i can mention the path of any html and if i save then given name will relate to the link selected

    now problem is eveyrtime i have to go on some tool called edith3.0 ther is check box called HTML-Informationen and i have to check then clcik on save to get html on my form and i want to avoid this.as i dont no how it works

    anybody know any simple script or link so that when i clcik on button configure html and save whatever the file i will get on link

    [code]
    <? if ($is_info) { ?>
    <? if ($active && $session->admin) { ?>
    <form action="infopath.phtml" method="get" target="content">
    <input type="hidden" name="tree" value="<?=$active ?>" />
    <input type="submit" class="midgray" value="CONFIGURE HTML" />
    </form>
    <? } ?>
    <body>
    <?
    $tree += 0;
    list($path) = once_query_array("SELECT html_file FROM t_directories WHERE sys_pk = $tree");
    ?>

    <form action="infopath.php" method="post">
    <input type="hidden" name="tree" value="<?=$tree ?>" />
    <table border="0" cellpadding="0" cellspacing="5">
    <tr><td>Relative path to directory or file:</td><td><input type="text" size="70" name="path" value="<?=htmlentities($path) ?>" /></td></tr>
    <tr><td></td><td align="center"><input type="submit" name="submit" value="change" /></td></tr>
    </table>
    </form>
    /body>


    thanks
    arun krishnan

  2. #2
    Join Date
    Feb 2003
    Location
    Derby, UK
    Posts
    456
    If I understand what you are asking correctly, one posible way would be to add some javascript to the links that sets the hidden field in the form to the correct path for that link, thereby priming the form for when the button is pressed.

    Once the button is pressed submit the form to a PHP script that can read the corresponding html file from disk on the server and output its contents into the edit control.

    I see that this function exists behind some form of admin protection, so you may be ok, but I should still mention that this method may represent a security risk unless you are very careful about the paths passed to your script (hacker could use the script to access files outside the web root).

    If for any reason you cant perform this server-side, then it should be possible (on ie5+ at least) to read the actual content of the right-hand frame using javascript (document.body.innerHTML I think) when the button is pressed and pass that into the edit page.

    HTH,

    Dai

  3. #3
    Join Date
    Jun 2003
    Posts
    181
    sorry i didnt understood this please do u ahve any link or any example so that i can implement on this as i m newbie in pgmming

    thanks for ur understanding
    arun krishnan

  4. #4
    Join Date
    Feb 2003
    Location
    Derby, UK
    Posts
    456
    No, sorry I don't know of any examples.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles