SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php Code Explanation

    Can someone please explain this php code. I would be grateful


    <?php
    // --------------- file tape2matlab2php.php

    // NOTE: if web-server and matlab server are NOT located on the same mashine please use share name.

    $path_data ="\MB_data\Field_Signals\";
    $path_out_file ="MB_dataout";
    $path_descr ="MB_datadesc";
    $path_MB_def ="MB_dataMB_def";
    $path_HDF ="MB_dataout";

    ?>




    <?php

    if (!isset($mode)) {
    $mode="init";
    }
    switch ($mode) {
    case 'init':
    include('inc_init_page.php');
    break;
    case 'run':
    ?>
    <form action="/cgi-bin/matweb.exe" method="POST">
    <input type="hidden" name="mlmfile" value="Tape2coord">
    <input type="hidden" name="dfname" value=" <?PHP echo $dfname ?>" >
    <input type="hidden" name="path_descr" value=" <?PHP echo $path_descr ?>" >
    <input type="hidden" name="path_data" value=" <?PHP echo $path_data ?>" >
    <input type="hidden" name="path_out_file" value=" <?PHP echo $path_out_file ?>" >
    <input type="hidden" name="path_HDF" value=" <?PHP echo $path_HDF ?>" >
    <p><input type="submit" name="Submit" value="Execute"></p>
    </form>
    <?PHP
    break;
    default:
    echo "End'";
    break;
    }
    ?>
    </BODY>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    code

    Guessing by the part that's shown, if the variable $mode is "run" and the user submits the form, the hidden variables are sent to the exe file.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks man, So is it possible if I run this php script on my webserver . Where I am passing some inputs from the flash and this script pass those inputs to the matweb.exe program as its doing in this case.( My point is does it require any user interaction)

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    form submit

    As it stands now, the form has a submit that a user could trigger. I supposer you could use javascript to trigger the submit instead.


Bookmarks

Posting Permissions

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