Jump to content

ranjuvs

Members
  • Posts

    135
  • Joined

  • Last visited

    Never

Posts posted by ranjuvs

  1. Hi kev wood,

     

    Change the portion

     

    if(!empty($row['image'])) {
             echo '<img src="images/'.$row['image'].'">';
             } 
    

     

    to

     

    $imgurl = "images/".$row['image'];
    if($row['image'] && file_exists($imgurl)) {
    echo "<img src=$imgurl>";
    }
    

     

    let me know if the issue persists

     

     

    Regards

    Ranju

  2. Try this

     

    <html>
    <head>
    <script type="text/javascript">
       
    function enable()
    {
       var obj1 = document.getElementById('call-monitor');
       var obj2 = document.getElementById('call-barg');
       var txtObj = document.getElementById('mySelect');
       var selValue1 = obj1.options[obj1.selectedIndex].value;
       var selValue2 = obj2.options[obj2.selectedIndex].value;
       
       if(selValue1 === "Enable" || selValue2 === "Enable"){
          txtObj.disabled=false;
          txtObj.style.backgroundColor = "";
       }else if(selValue1 === "Disable" && selValue2 === "Disable"){
          txtObj.disabled=true;
          txtObj.style.backgroundColor = "#cccccc";
       }
    }
    
    </script>
    </head>
    <body>
    
    <form>
    <select id="call-monitor" name="call-monitor" onChange="enable()">
    <option value="Enable">Enable</option>
    <option value="Disable">Disable</option>
    
    </select>
    <br /><br />
    <select id="call-barg" name="call-barg" onChange="enable()">
    <option value="Enable">Enable</option>
    <option value="Disable">Disable</option>
    
    </select>
    <br /><br />
    <input type="text" id="mySelect" name="mySelect" />
    </form>
    
    </body>
    </html>
    

  3. Hi Nandini,

     

    Try this

     

    <html>
    <head>
    <script type="text/javascript">
    function enable()
    {
    var obj = document.getElementById('s');
    var txtObj = document.getElementById('mySelect');
    var selValue = obj.options[obj.selectedIndex].value
    
    if(selValue === "Enable"){
    	txtObj.disabled=false;
    	txtObj.style.backgroundColor = "";
    }else if(selValue === "Disable"){
    	txtObj.disabled=true;
    	txtObj.style.backgroundColor = "#cccccc";
    }
    }
    </script>
    </head>
    <body>
    
    <form>
    <select id="s" name="s" onchange="enable()">
    <option value="Enable">Enable</option>
    <option value="Disable">Disable</option>
    
    </select>
    <br /><br />
    <input type="text" id="mySelect" name="mySelect" />
    </form>
    
    </body>
    </html>
    

     

    I have also added code to change the background color. this is because in I.E disabled and enabled textbox will look same.

     

    Regards

    Ranju

  4. Let the first table be table1 and second be table2

     

    Let us suppose that we have the result rows(fetched from db) of table1 in rows1 and table2 in rows2 (as an object)

     

    solution for question 1

     

    foreach($rows1 as $row1) {
        echo "<b>$row->date</b><br />";
        echo $row->name. ' ' . $row->activity."<br />";
    }
    

     

    solution for question 2

     

    foreach($rows2 as $row2) {
        echo $row2->name."<br />";
        echo "<select name='likes'>";
               if($row2->pie){
                   echo "<option value='$row2->pie'>$row2->pie</option>";
               }
               if($row2->cake){
                   echo "<option value='$row2->cake'>$row2->cake</option>";
               }
               if($row2->bread){
                   echo "<option value='$row2->bread'>$row2->bread</option>";
               }
               if($row2->eggs){
                   echo "<option value='$row2->eggs'>$row2->eggs</option>";
               }
               if($row2->butter){
                   echo "<option value='$row2->butter'>$row2->butter</option>";
               }
               if($row2->cheese){
                   echo "<option value='$row2->cheese'>$row2->cheese</option>";
               }
               if($row2->pancakes){
                   echo "<option value='$row2->pancakes'>$row2->pancakes</option>";
               }
        echo "</select><br />";
    
    }
    

     

    Kindly test it(as I haven't tested the code) and get back to me if you are having any issues.

     

    Regards

    Ranju

  5. <?php
    $strings = array("This is line number 1",
    			"This is colour green",
    			"This is a silly example");
    $replace = "This is";
    
    $new_strings = array();
    
    $strings = str_replace($replace,'',$strings);
    echo "<select name='string'>";
    foreach($strings as $string) {
    echo "<option value=''>$string</option>";
    }
    echo '</select>';
    ?>
    

  6. First of all you need fetch data from db using mysql_fetch_array or mysql_fetch_object

    $result = mysql_query('SELECT max(customer_id) as max_cust_id FROM customers'); 
    
    $max_customer = mysql_fetch_array($result);
    
    echo $max_customer[0][max_cust_id];
    

     

     

  7. Try this

     

    <?php
    
    
    
    <?php
    
    
    
    class IPTC{
       var $meta;
       var $image;
       
    
          function __construct($image){
          
          
            $this->image=$image;
      
             $this->meta = array(
          'credit' => '',
          'caption' => '',
          'created_timestamp' => 0,
          'copyright' => '',
          'title' => '',
          );
             
          $size=getimagesize($image,$info); 
           if ( isset ($info['APP13'])) {
            $iptc=iptcparse($info['APP13']);
                   
            if ( !empty($iptc['2#110'][0]) ) 
               $this->meta['credit'] = utf8_encode(trim($iptc['2#110'][0]));
             elseif ( !empty($iptc['2#080'][0]) ) 
                $this->meta['credit'] = utf8_encode(trim($iptc['2#080'][0]));
             if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) 
                $this->meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]);
             if ( !empty($iptc['2#120'][0]) ) // caption
                $this->meta['caption'] = utf8_encode(trim($iptc['2#120'][0]));
             if ( !empty($iptc['2#116'][0]) ) // copyright
                $this->meta['copyright'] = utf8_encode(trim($iptc['2#116'][0]));
             if ( !empty($iptc['2#005'][0]) ) // title
                $this->meta['title'] = utf8_encode(trim($iptc['2#005'][0]));
    
        }
      }
      
      function get_credit(){
         return $this->meta['credit'];
         
         }
         
         
      function get_timestamp(){
         return $this->meta['created_timestamp'];
         
         }
         
         
           function get_caption(){
         return $this->meta['caption'];
         
         }
         
         
           function get_copyright(){
    	  return $this->meta['copyright'];
         
         }
         
          function get_title(){
         return $this->meta['title'];
         
         }
         
    }   
       
       
    $image_info = new IPTC('ARPC.JPG') or die ('kan geen iptc gegevens extracten uit image');
    $res = $image_info->get_copyright()or die('geen copyright beschikbaar');       
    echo $res;   
    

  8. label doesn't have a value property instead use innerText property

     

    instead of this

     

    echo ' document.getElementById("statusMsgOutput").value = "'.$errorMsgDefinitionsArray[$messageKey].'";
    

     

    use

     

    echo ' document.getElementById("statusMsgOutput").innerText = "'.$errorMsgDefinitionsArray[$messageKey].'";
    

  9. try this...

     

    <?php
    echo "<table border=1>";
          echo "<tr>";
    $qry1="select * from product_table";  
    $result1 = mysql_query($qry1);          
       if(mysql_num_rows($result1)>0)
       {
       while($row1=mysql_fetch_array($result1))
       {
      
                echo "<td width=148>";
          
          echo "<table border=1 bgcolor=#ffddee>";
          echo "<tr>";
          echo "<td width=125>" . "<img width=116 height=117 src='admin/uploads/" . $row1['image'] . "'/>" . "</td>";
          echo "</tr>";
          echo "<tr>";
          echo "<td valign=top  width=125>". $row1['product_name'] . "</td>";
          echo "</tr>";
          echo "<tr>";
          echo "<td valign=top>". $row1['description'] . "</td>";
          echo "</tr>";
          echo "<tr>";
          echo "<td valign=top class=cut>". $row1['cutout_price'] . "</td>";
          echo "</tr>";
          echo "<tr>";
          echo "<td valign=top>". $row1['price'] . "</td>";
          echo "</tr>";
          echo "</table>";
    echo "</td>";
       }
      
       }
          echo "</tr>";
    echo "</table>"; 
    ?>
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.