Basic .php coding question

Please have mercy on this utter noob with .php coding.
Situation:
People submit their data forms, which I receive like this:
These include a results file, here called 'Output.txt' which is required and optionally include 'Output-MPE.txt'.
When I receive both files, the last five fields are extracted from both these files. To achieve that I use the following code:
function makeupFiveFieldValues( $recordID ){
    if( !isset($_FILES) )
        return ;
    $resultFile = $_FILES[ "field_27" ][ "tmp_name" ] ;
    $mpeFile    = $_FILES[ "field_28" ][ "tmp_name" ] ;
    if( is_uploaded_file( $resultFile ) && is_uploaded_file( $mpeFile )  ) {
        $line = join("",file($resultFile));
        list( $io, $dvd, $h264, $mpeOn ) = split(',',str_replace('"','', $line));
        $line = join("",file($mpeFile));
        list( $io, $dvd, $h264, $mpeOff ) = split(',',str_replace('"','', $line));
        $_POST['field_29'] = $io;
        $_POST['field_30'] = $dvd;
        $_POST['field_31'] = $h264;
        $_POST['field_32'] = $mpeOn;
        $_POST['field_33'] = $mpeOff;
However:
When I only receive 'Output.txt' and not 'Output-MPE.txt', this code does not extract the correct data from the first file and shows up like this:
Being an utter noob with .php coding, I can only assume this is caused by the statement:
    if( is_uploaded_file( $resultFile ) && is_uploaded_file( $mpeFile )  )
which apparently assumes both files need to be submitted. But if only 'Output.txt' has been submitted, it still needs to extract the first 4 values from the submitted file. How do I need to change the code?

If your assumption is correct, try changing the && to ||, this changes it from "and" to "or"
Gary

Similar Messages

  • Contact form-checkbox PHP coding doesnt work

    I am a beginner to web page design so i would be grateful if you can explain to me what PHP coding i would need for 'Checkbox' and where to place it in the PHP coding below. I can submit the form to my email with all the headings and the filled in forms with checkbox Yes or No.
    Only problem i have is that part of the check box info appear right at the top of the email message rather than the 'Name', 'Tel', 'Email' etc..Another half of the checkbox appear where it suppose to be wih double heading as shown below. I would also like to remove the <br> from the email message. Can you also tell me how to change the colour for heading so its clear.
    I have marked the checkbox code in BLUE for both HTML and PHP coding below. Sorry for the long coding. Look forward to hearing from someone. Much appreciated.
    Message delivered to the email address as received:
    Rear ground extension: Yes
    Two-storey rear extension: Yes
    Two-storey side extension: No
    Loft: Yes
    New Build: Yes
    Other: Yes
    Name: Test<br>
    Email: [email protected]<br>
    Contact No: 87576as<br>
    Address1: addy1<br>
    Address2: addy2<br>
    Town: town<br>
    County: county<br>
    Postcode: post<br>
    Property Type: Cottage<br>
    Property Area: None<br>
    Message:<br>
    test msg
    My HTML coding for the form:
    <div class="contactForm">
          <form id="form1" name="form1" method="post" action="test2.php">
            <fieldset>
              <legend><strong>Personal Information</strong></legend>
              <table width="690" border="0">
                <tr>
                  <td width="340"><p>
                <label for="name" class="contactLable">Name:</label>
                <input name="name" type="text" id="name" tabindex="10" size="30" />
              </p></td>
                  <td width="340"><p>
                <label for="contact_number" class="contactLable">Contact No:</label>
                <input name="contact_number" type="text" id="contact_number" tabindex="20" size="30" />
              </p></td>
                </tr>
              </table>
              <table width="690" border="0">
                <tr>
                  <td><p>
                <span id="sprytextfield1">
                <label for="email" class="contactLable">Email:</label>
                <input name="email" type="text" id="email" tabindex="30" size="30" />
              <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> </p></td>
                </tr>
              </table>
            </fieldset>
            <fieldset>
              <legend><strong>Project Information</strong></legend>
              <p><table width="690" border="0">
      <tr>
        <td width="340"><p>
                <label for="address1" class="contactLable">Address 1:</label>
                <input name="address1" type="text" id="address1" tabindex="40" size="30" />
              </p></td>
        <td width="340"> <p>
                <label for="address2" class="contactLable">Address 2:</label>
                <input name="address2" type="text" id="address2" tabindex="50" size="30" />
              </p></td>
      </tr>
      <tr>
        <td><p>
                <label for="town" class="contactLable">Town:</label>
                <input name="town" type="text" id="town" tabindex="60" size="30" />
              </p></td>
        <td><p>
                <label for="county" class="contactLable">County:</label>
                <input name="county" type="text" id="county" tabindex="70" size="30" />
              </p></td>
      </tr>
      <tr>
        <td><p>
                <label for="postcode" class="contactLable">Post Code:</label>
                <input name="postcode" type="text" id="postcode" tabindex="80" size="10" />
              </p></td>
        <td> </td>
      </tr>
      <tr>
        <td><p>
                <label for="propertyType" class="contactLable">Property Type:</label>
                <select name="propertyType" id="propertyType" tabindex="90">
                  <option>Please select</option>
                  <option>Detached</option>
                  <option>Semi-Detached</option>
                  <option>End of Terrace</option>
                  <option>Mid-Terrace</option>
                  <option>Flat</option>
                  <option>Bungalow</option>
                  <option>Cottage</option>
                  <option>Other</option>
                </select>
              </p></td>
        <td><p>
                <label for="propertyArea" class="contactLable">Property Area:</label>
                <select name="propertyArea" id="propertyArea" tabindex="100">
                  <option>Please select</option>
                  <option>None</option>
                  <option>Listed Building</option>
                  <option>Conservation Area</option>
                </select>
              </p></td>
      </tr>
    </table>
    </p>
           </fieldset><fieldset><legend><strong>Project Type</strong></legend>
              <table width="690">
                <tr>
                  <td width="338"><label>
                    <input name="rearExt" type="checkbox" class="contactCheckbox" id="CheckboxGroup1_0" tabindex="110" value="rearExt"/>
                  Rear ground extension</label></td>
                  <td width="340"><input name="sideExt" type="checkbox" class="contactCheckbox" id="CheckboxGroup1_1" tabindex="120" value="sideExt"/>
    Side ground extension</td>
                </tr>
                <tr>
                  <td><input name="twoStoreyRear" type="checkbox" class="contactCheckbox" id="twoStoreyRear" tabindex="130" value="twoStoreyRear"/>
    Two-storey rear extension</td>
                  <td><input name="twoStoreySide" type="checkbox" class="contactCheckbox" id="twoStoreySide" tabindex="140" value="twoStoreySide"/>
    Two-storey side extension</td>
                </tr>
                <tr>
                  <td><input name="loft" type="checkbox" class="contactCheckbox" id="loft" tabindex="150" value="loft"/>
    Loft conversion </td>
                  <td><input name="newBuild" type="checkbox" class="contactCheckbox" id="newBuild" tabindex="160" value="newBuild"/>
    New build </td>
                </tr>
                <tr>
                  <td><input name="flat" type="checkbox" class="contactCheckbox" id="flat" tabindex="170" value="flat"/>
    Flat conversion</td>
                  <td><input name="other" type="checkbox" class="contactCheckbox" id="other" tabindex="180" value="other"/>
    Other conversion</td>
                </tr>
              </table>
            </fieldset>
            <fieldset><legend><strong>Message</strong></legend>
              <p>
                <label for="message" class="contactLable">Your Message or Comments:</label>
                <textarea name="message" id="message" cols="45" rows="5" tabindex="190"></textarea>
              </p>
            </fieldset>
            <br />
            <input type="submit" name="Sumbit" id="Sumbit" value="Submit" tabindex="200" />
          </form>
        </div>
    PHP Coding to send to my email:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
    <title>Email Form</title>
    </head>
    <body>
    <?php
      $name=addslashes($_POST['name']);
      $contact_number=addslashes($_POST['contact_number']);
      $email=addslashes($_POST['email']);
      $address1=addslashes($_POST['address1']);
      $address2=addslashes($_POST['address2']);
      $town=addslashes($_POST['town']);
      $county=addslashes($_POST['county']);
      $postcode=addslashes($_POST['postcode']);
      $propertyType=addslashes($_POST['propertyType']);
      $propertyArea=addslashes($_POST['propertyArea']);
      $rearExt=($_POST['rearExt'])?"Rear ground extension: Yes":"Rear ground extension: No";
      $sideExt=($_POST['sideExt'])?"Side ground extension: Yes":"Side ground extension: No";
      $twoStoreyRear=($_POST['twoStoreyRear'])?"Two-storey rear extension: Yes":"Two-storey rear extension: No";
      $twoStoreySide=($_POST['twoStoreySide'])?"Two-storey side extension: Yes":"Two-storey side extension: No";
      $loft=($_POST['loft'])?"Loft: Yes":"Loft: No";
      $newBuild=($_POST['newBuild'])?"New Build: Yes":"New Build: No";
      $flat=($_POST['flat'])?"Flat: Yes":"Flat: No";
      $other=($_POST['other'])?"Other: Yes":"Other: No";
      $msg.="\n$rearExt\n$wsideExt\n$twoStoreyRear\n$twoStoreySide\n$loft\n$newBuild\n$wflat\n$ other";
      $message=addslashes($_POST['message']);
    // you can specify which email you want your contact form to be emailed to here
      $toemail = "[email protected]";
      $subject = "From Website Test";
      $headers = "MIME-Version: 1.0\n"
                ."From: \"".$name."\" <".$email.">\n"
                ."Content-type: text/html; charset=iso-8859-1\n";
      $body = "Name: ".$name."<br>\n"
                ."Email: ".$email."<br>\n"
                ."Contact No: ".$contact_number."<br>\n"
                ."Address1: ".$address1."<br>\n"
                ."Address2: ".$address2."<br>\n"
                ."Town: ".$town."<br>\n"
                ."County: ".$county."<br>\n"
                ."Postcode: ".$postcode."<br>\n"
                ."Property Type: ".$propertyType."<br>\n"
                ."Property Area: ".$propertyArea."<br>\n"
                ."Rear ground extension: ".$rearExt."<br>\n"
                ."Side ground extension: ".$sideExt."<br>\n"
                ."Two-storey rear extension: ".$twoStoreyRear."<br>\n"
                ."Two-storey side extension: ".$twoStoreySide."<br>\n"
                ."Loft conversion: ".$loft."<br>\n"
                ."New build: ".$newBuild."<br>\n"
                ."Flat: ".$flat."<br>\n"
                ."Other: ".$other."<br>\n"
                ."Message:<br>\n"
                .$message;
      if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
        echo "That is not a valid email address.  Please return to the"
               ." previous page and try again.";
        exit;
        mail($toemail, $subject, $body, $msg, $headers);
        echo "Thanks for submitting your comments";
    ?>
    </body>
    </html>

    Dear David
    Thank you so much for the clear explanation. I have been using Lynda.com Dreamweaver CS5 tutorial. I found the coding for checkbox through search and added to the coding from Lynda.com tutorial.
    I made few changes to the coding by removing:
    $msg = "$rearExt<br>\r\n$sideExt<br>\r\n$twoStoreyRear<br>\r\n
              $twoStoreySide<br>\r\n$loft<br>\r\n$newBuild<br>\r\n$flat<br>\r\n$other\r\n";
    as the email message shows the results from the checkbox twice.
    I also removed the <br> from:
    $body = "Name: $name<br>\r\n
              Email: $email<br>\r\n
              Contact No: $contact_number<br>\r\n
             Other: $other\r\n
              Message:\r\n
                $message";
    I have add the result and the PHP coding you have helped to fixed for anyone needing a working PHP code containing Text Fields, Drop Down List, Checkbox and Text Area. Many thanks for all your help. If you have a coding to change the heading text colour I very much appericate it.
    Message sent to email:
              From: Name test <[email protected]>
                 Content-type: text/html; charset=iso-8859-1
    Name: Name test
              Email: [email protected]
                      Contact No: 0123456789
                      Address1: addy1
                      Address2: addy2
                      Town: T
                      County: C
                      Postcode: P/C
                      Property Type: End of Terrace
                      Property Area: Listed Building
                      Rear ground extension: Rear ground extension: No
                     Side ground extension: Side ground extension: No
                     Two-storey rear extension: Two-storey rear extension: Yes
                     Two-storey side extension: Two-storey side extension: No
                     Loft conversion: Loft conversion: No
                     New build: New Build: No
                     Flat: Flat: Yes
                     Other: Other: No
             Message:
               Test message
    PHP coding for customer contact page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <META HTTP-EQUIV="refresh" content="0;URL=thankyou.html">
    <title>Email Form</title>
    </head>
    <body>
    <?php
      $name=$_POST['name'];
      $contact_number=$_POST['contact_number'];
      $email=$_POST['email'];
      $address1=$_POST['address1'];
      $address2=$_POST['address2'];
      $town=$_POST['town'];
      $county=$_POST['county'];
      $postcode=$_POST['postcode'];
      $propertyType=$_POST['propertyType'];
      $propertyArea=$_POST['propertyArea'];
      $rearExt= isset($_POST['rearExt'])?"Rear ground extension: Yes":"Rear ground extension: No";
      $sideExt= isset($_POST['sideExt'])?"Side ground extension: Yes":"Side ground extension: No";
      $twoStoreyRear= isset($_POST['twoStoreyRear'])?"Two-storey rear extension: Yes":"Two-storey rear extension: No";
      $twoStoreySide= isset($_POST['twoStoreySide'])?"Two-storey side extension: Yes":"Two-storey side extension: No";
      $loft= isset($_POST['loft'])?"Loft conversion: Yes":"Loft conversion: No";
      $newBuild= isset($_POST['newBuild'])?"New Build: Yes":"New Build: No";
      $flat= isset($_POST['flat'])?"Flat: Yes":"Flat: No";
      $other= isset($_POST['other'])?"Other: Yes":"Other: No";
      $message=$_POST['message'];
    // you can specify which email you want your contact form to be emailed to here
      $toemail = "[email protected]";
      $subject = "From Website Test";
      $headers = "MIME-Version: 1.0\r\n
                 From: $name <".$email.">\r\n
                 Content-type: text/html; charset=iso-8859-1";
      $body = "Name: $name\r\n
              Email: $email\r\n
              Contact No: $contact_number\r\n
              Address1: $address1\r\n
              Address2: $address2\r\n
              Town: $town\r\n
              County: $county\r\n
              Postcode: $postcode\r\n
              Property Type: $propertyType\r\n
              Property Area: $propertyArea\r\n
              Rear ground extension: $rearExt\r\n
              Side ground extension: $sideExt\r\n
              Two-storey rear extension: $twoStoreyRear\r\n
              Two-storey side extension: $twoStoreySide\r\n
              Loft conversion: $loft\r\n
              New build: $newBuild\r\n
              Flat: $flat\r\n
              Other: $other\r\n
              Message:\r\n
                $message";
      if (!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $email))
        echo "That is not a valid email address.  Please return to the"
               ." previous page and try again.";
        exit;
        mail($toemail, $subject, $body, $headers);
        echo "Thanks for submitting your message";
    ?>
    </body>
    </html>

  • Need help making basic php gallery.

    Hi guys,
    Thanks for checking out my post...
    I want to create a gallery, using php, for a client site
    similar to the one at
    http://www.danwheldon.com/gallery.cfm
    where you click on a thumbnail and it refreshes the page with the
    larger image within the websites' layout and above the rest of the
    thumbnails.
    At the moment, my site has a template layout called main.php
    and I'm using a basic php query to bring up gallery.php
    (main.php?pagename=gallery) so the thumbnails are displayed in the
    template.
    How can I add another query to the links so that when you
    click on one of the thumbnails, it refreshes
    main.php?pagename=gallery with the enlarged image above the rest of
    the thumbnails?
    Thank you very much and I hope to hear from you.
    All the best,
    Mark

    Spindrift wrote:
    > How can I add another query to the links so that when
    you click on one of the
    > thumbnails, it refreshes main.php?pagename=gallery with
    the enlarged image
    > above the rest of the thumbnails?
    Seb posted this the other day. I think it fits in with what
    you want and
    can be adapted.
    Someone asked. How are pages created like this:
    http://www.foo.com/fooing.php?id=10
    http://www.foo.com/fooing.php?id=20
    ANSWER:
    whatever is after the "?" is a variable ("id") and its value
    ("20").
    The variable value is retreived by PHP via the $_GET array:
    <?php
    $var = $_GET['id'];
    echo $var;
    ?>
    This will output the variable value (10 or 20).
    Then you can use these values to outuput different things:
    <?php
    $var = $_GET['id'];
    if ($var == 10){
    do_something();
    if ($var == 20){
    do_someting_else();
    ?>
    A typical example would be with an image gallery, each
    thumbnail would
    have a link to the same page, but with a different variable:
    <a href="big_image.php?id=10"><img
    src="thumb10.jpg"></a>
    so each thumbnail would open the same page, but in this page,
    the
    approperiate bigger image would be outputted buy PHP
    according to the
    variable:
    <?php
    $big_image = $_GET['id'].'.jpg';
    echo '<img src="'.$big_image.'">';
    ?>
    this will output:
    <img src="10.jpg">

  • Basic Hyperion Workspace question

    Is there any way to Drill-Down to data by double-clicking on the chart item in Hyperion Workspace? I can do this in Hyperion Reporting Studio.

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Basic recording/feedback question

    I'm recording basic vocals against accompaniment tracks using an APOGEE ONE and Audio-Technica 40 series AT8449 condenser mic. I use only headphones, no external speakers.
    If I record with "monitoring" on I constantly battle feedback/distortion, especially on songs with a wide dynamic range. When the feedback protection kicks in the message indicates that I'm getting feedback through my external speakers (which I don't have), I can minimize the problem by turning "monitoring" off but I lose the reference vocal. I know I must be overlooking something very simple. Any help is appreciated.

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Basic PDF/SSL Question

    Okay, I know this is a basic question, and I'm not sure if this is really where I should be posting it, but maybe someone out there has experience with this.
    I have a PDF form sitting on a secure server.  I have it set up to email the completed PDF back to our company when the user clicks the SUBMIT buttton.  Whether or not the PDF is secure coming back to us would be dependent on the email server the user uses - not that the form sits in a secure area on our server or that the PDF is security settings are set, correct?
    Any input appreciated.
    Thanks
    Q

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Basic wifi service question

    basic wifi service question
    A Windows-using friend of mine subscribes to a service from Verizon that is sort of like a cell phone for a computer - wifi service that you can access from theoretically anywhere, for something like $60 a month -
    as far as I can determine, one CAN get this for Mac but ONLY if you have a 15 or 17 inch laptop with PC slots - unless I am missing something. It requires a special kyocera card.
    Another company, T-Mobile, offers a similar service, but with no MAC access at all.
    So my question is: is there a similar service, wi-fi access theoretically anywhere (or even just anywhere in New York City) ? Hopefully with just the regular mac airport card and not any additional special hardware?
    Thanks!
    Will

    Hello WillFriedwald2
    The kind of service your describing is probably a 3G and GPRS service.
    Phone companies now offer mobile high speed connections using EDGE technology or GPRS2 and supply a 3G or GPRS PCMCIA card.
    However some companies are now offering a package whereby you get high speed 3g and gprs and also wifi.
    So to use this service on a laptop that has no PC card slot you need to get a 3G or GPRS2 phone that supports blue tooth then you can connect your laptop to the phone over bluetooth and therefore access high speed internet.
    But if you had a desktop mac such as a G5 you would be better just getting a regular cable or dsl connection in your home and invest in a wireless router.

  • Basic JDBC transactional question

    Hello all,
    I have (what I believe) is a basic transactional JDBC question.
    Here's what I want to do:
    begin transaction
    select a row from a table where (some condition).
    that row may or may not exist.
    if the row exists: update the row
    else if the row does not exist, insert a new row
    end transaction
    I want this entire thing to be atomic .. I don't want the select to complete, then have something else come in there before the update/insert takes place.
    I'm using MySQL .. I seem to remember hearing about some proprietary MySQL command which would do a SELECT + UPDATE atomically .. which would be fine, but I can't find it.
    Wrapping this with a row-level lock would be fine too .. I'm just not sure how to do that in JDBC.
    Thanks!
    -d

    By thte way, and not that it helps the orignal poster, who's using MySQL, but Oracle has a proprietary MERGE statement that does "insert or update" in one go. For example:
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*0.1)
         WHERE (S.salary <= 8000);

  • Basic Clone database question

    hi all,
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.
    Hope u understand
    Thanks,
    Neerav

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • The most BASIC PHP question imaginable.

    I am working my way through the Lynda.com PHP Essential Training.
    I have MYSQL, Apache & PHP all installed an working.
    If I type this code into textedit, and save it as test.php, and view it in Safari, then every works as expected:
    <head>
    <title>PHP test</title>
    </head>
    <body>
    <?php echo "Hello World!"; ?>
    </body>
    </html>
    and I see "Hello World!" on the screen.
    If I create a new PHP file in Dreamweaver CS4 and enter
    <?php echo "Hello World!"; ?>
    I see that the code looks pretty much identical in the code pane, but when I run it, instead of seeing "Hello World" I see: <?php echo "Hello World!"; ?>.
    Clearly, there is something (presumably to do with the server side, that I am not setting properly, BUT WHAT???  I am absolutely pulling my hair out over this.
    Any suggestions??
    Thanks,
    Peter

    This is a duplicate thread. Now locked.

  • Basic  XML Publisher Question: How to access tags in the higher levels?

    Hi All,
    We have a basic question in XML Publisher.
    We have a xml hierarchy like below:
    <CD_CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 1</CAT_NAME>
    <CD>
    <TITLE>TITLE1 </TITLE>
    <ARTIST>ARTIST1 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE2</TITLE>
    <ARTIST>ARTIST2 </ARTIST>
    </CD>
    </CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 2</CAT_NAME>
    <CD>
    <TITLE>TITLE3 </TITLE>
    <ARTIST>ARTIST3 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE4</TITLE>
    <ARTIST>ARTIST4 </ARTIST>
    </CD>
    </CATALOG>
    </CD_CATALOG>
    We need to create a report like below:
    CATALOG_NAME     CD_TITLE     CD_ARTISTCATALOG 1     TITLE1     ARTIST1
    CATALOG 1     TITLE2     ARTIST2
    CATALOG 2     TITLE3     ARTIST3
    CATALOG 2     TITLE4     ARTIST4
    So we have to loop at the level of <CD> using for-each CD. But when we are inside this loop, we cannot access the value of CAT_NAME which is at a higher level.
    How can we solve this?
    Right now, we are using the work-around of set_variable and get_Variable. We are setting the value of CAT_NAME inside an outer loop, and using it inside the inner loop using get_variable.
    Is this the proper way to do this or are there better ways to do this? We are running into troubles when the data is inside tables.

    you can use
    <?../CAT_NAME?>copy past to your template
    <?for-each:CD?> <?../CAT_NAME?> <?TITLE?> <?ARTIST?> <?end for-each?>

  • Basic PHP Support with Live Preview

    I use PHP includes when coding so I only have to code my navigation once, and then I can include it on other pages. Is their anyway to get this to work with Adobe Edge Code so I don't have to switch back to using .html files?
    If not, I guess I could transition back, although, I really would rather not.
    Thanks,
    David Faircloth

    The website root in this case is http://localhost:8888/ajax_login/ I even cut and pasted the value from my Dreamweaver Site Setup for this project (which works fine):
    Also I tried it your way and it still didn't work.

  • Basic VT / Video Question

    I am upgrading my CM to v4.2 this month and looking to do a limited implemenation of some video. I have read the basics on VT Advantage solution and had some questions I can't seem to find the answers to:
    1. Besides the obvious desktop software and hardware (camera) installation, what additonal configuration changes do I need to make to CM/Unity/gateways to get video working in the environment?
    2. What kind of additional load is now placed on the network with video and what will this do to my current bandwidth configurations?

    Michael,
    First off you should check out the IP Video Telephony SRND if you are thinking about deploying video. Here is the link. (It's a 4.1 reference but should be 99% the same for 4.2).
    http://www.cisco.com/application/pdf/en/us/guest/netsol/ns268/c649/ccmigration_09186a00804ff6ba.pdf
    Somewhat brief answers to your questions.
    1. QoS for video on all network devices. The above guide discusses this but the Enterprise QoS SRND is the best reference. Switched only VT advantage isn't that hard. If you have WAN links then the LLQs should be configured independantly for video and voice(still only one llq though but this will ease admin and give the ability to police the video). Call Manager locations can be created to help enforce Call Admission Control of video calls. Provisioning the bandwidth is going to be one of the harder things to configure.
    ACLs will need to be adjusted for PC/Cam to Phone communication. The phone proxies the connection for the Camera and determines the camera via CDP (local on the phone switch) and then sets up a TCP connection traversing L2 vlans to L3 router and back. So if you have Phone acls they need to be adjusted. Again this is referenced in the above document.
    Regions for video types. You have a few options on video quality. This response will also answer 2. You can choose Cisco wideband, 7mps each direction for the highest quality and low amount of system overhead on the pc cpu. Of course this takes up a total 14mb for video. Should only be used on local lan. Then you have increments of h263. They range from 128 up to 1536. The higher the bandwidth the better the quality and more cpu on the local pc. You will need to use regions to set the desired video codecs and locations to enforce the bandwidth the codecs require.
    Lastly multipoint conferencing and other video endpoint integration. If you want conference with video you need to add MCUs. Currently (not sure on 4.2) CCM has a limitation on determining Video conference resources in an intelligent fashion. Essentially you need to have any video MCUs at the top of your MRGLs in CCM. This leaves the potential for Audio only conferences happening on very expensive video conference bridges. This calls for Device Pool and MRGL design changes for people who really only need multi-point video conferences.
    Read that SRND, great resource.
    Please rate any helpful posts
    Thanks
    Fred

  • A few basic iPhoto 11 questions

    I just updated my iMac from Tiger (I know...) to Mavericks and it's great, but there's a few things in iPhoto that are way different from my old version- wondering if I can re-apply these.
    1) I used to be able to label photos by hovering over the photo and a dialogue box would appear, then once I titled it the title would stay under the photo. I can title photos now by going to info and titling it but when I'm in album view I can't see the titles whereas I used to.  I looked in preferences and everything but can't change it, is there a way to do this?
    2) This one is basic and stupid- in my old version just 1 click would enlarge the photo from album view vs highlighting it and needing to double click to enlarge.  Any way to revert this back to the old way? 
    I know these are really stupid questions but it's just conveniences I got used to that would be nice to have back.

    1. View Menu -> Select 'Titles'
    2. Tap the Space Bar.

  • BDB XML + PHP, some questions

    Hello, nice to be there...
    I've got some questions...
    Now, im writing application in PHP and using the Berkeley DB XML.
    I wrote some code, but i cant find the documentation to using Berkeley DB XML in PHP.
    My code are look that, some comments to understanting...
    <?php
    // Version of BDBXML
    print(dbxml_version());
    echo "<br/>";
    $con_name="container.dbdbxml";
    // Initialize XmlManager
    $mgr = new XmlManager();
    if($mgr->existsContainer($con_name)) $mgr->removeContainer($con_name);
    * Container location: C:/Documents and Settings/UserName/
    $con = $mgr->createContainer($con_name);
    // Opening container
    $mgr->openContainer($con_name);
    // Adding XML documents
    $con->putDocument(1, "<base><element1>String text</element1><element2>Integer</element2></base>");
    $con->putDocument(2, "<base><element1>String text 2</element1><element2>Integer 2</element2></base>");
    // Iteriation adding documents
    $iter = 3;
    for($i=0;$i<20;$i++) {
    $con->putDocument($iter, "<base><element1>String text ".$iter."</element1><element2>Integer ".$iter."</element2></base>");
    ++$iter;
    // Documents the container
    $res = $con->getAllDocuments();
    $res->reset();
    // Couting the elements
    $count = $con->getNumDocuments(); echo "Numbers of count - documents: ".$count."<br/>";
    // Listing the resultset using getAllDocuments
    while($res->hasNext()) {
    $value = $res->next();
    $doc = $value->asDocument();
    print $doc->getName()." = ".$value->asString()."<br/>";
    // Listing the result set using query,
    $qc = $mgr->createQueryContext();
    $qc->setDefaultCollection($con_name);
    $query="collection(\"container.dbdbxml\")";
    $res2 = $mgr->query($query);
    // Size of result set
    $size = $res2->size(); echo "Size of resultset: ".$size."<br/>";
    $res2->reset();
    while($res2->hasNext()) {
    $value = $res2->next();
    $doc = $value->asDocument();
    print $doc->getName()." = ".$value->asString()."<br/>";
    ?>
    Now, I want to know those things:
    *1. Can I create the Container which autoincrement names the files? Example: putDocuments(AutoIncrementname,FileDocument);*
    Can I increment that in the container?
    *2. How I can create relation with containers?*
    For example:
    Container1 -> Document1 [  <xml id="1"><name>Something</name></xml>  ]
    Container2 -> ExtraDocument1 [ <base> <id>1</id> <names>Pre Name</names><relation> *" Here is relation to Container1 @ id "* </relation></base> ]
    *3. Where I can find the classes for using in PHP?*
    Thank You for answers and Really Sorry For My Bad English!
    Edited by: user12232307 on 2010-02-11 10:32

    Hi,
    I'm not using PHP, but probably some ideas would be helpful:
    1) In Java there is a XmlDocumentConfig class and its method setGenerateName(boolean). If you set it to true and provide a XmlDocumentConfig object to a putDocument() method, then DB XML will generate names for you with default prefix 'dbxml_' and the incremental numeric id (if I remember correctly), but the incremental numeric id is not guaranteed by DB XML, only that the document name will be an unique value (at least according to the documentation). You can change this prefix by providing a name of XmlDocument object that you are trying to put. Then the final name of a document will be "<your_doc_name>_id".
    2) It depends what you mean by relation? Why don't just use the name of a container?
    3) All that I was able to find by quick googling is http://www.oracle.com/technology/products/berkeley-db/pdf/building-php-applications-with-db-xml.pdf
    Vyacheslav

Maybe you are looking for

  • Imac + Playstation 3 = disaster for airport

    I bought my current 24", 2.8 ghz Imac one month ago and have never experienced problems with my wireless service. Last week I bought a playstation 3 and connected it wirelessly to the same router. Now, whenever I try and access the internet on my Ima

  • Project Online Permissions

    Hi!!! I am new to Project Online. So far, I have created many users (Project Lite) and (1) Project Manager (Project Full). The PM can create Projects and share them with other users. The problem is when the PM wants to grant Access to other users, th

  • ABAP Web Dynpro CSS Stylesheets

    Hallo, I have a question concerning "ABAP Web Dynpro". My current task is to implement an application for our company intranet. This application must have the look an feel (corporate design) of the company I'm working for. How can I manage this by us

  • Oracle RAC: SAPDBHOST on DEFAULT profile

    Hi all. We are testing a RAC solution in a Distribuited Architecture: Central Instance on Windows Server 2003, DB on two Linux (RedHat5.2) nodes. The problem is STMS configuration. Apparently, we need to set the parameter SAPDBHOST of the default pro

  • Actions won't transfer?

    I have 5 separate Captivate projects I am trying to merge.  Whenever I try and copy and past, import slides from one project to another, etc. the actions do not transfer with the slide.  Is there a way around this?  Think I have tried every possible