Jump to content

ranjuvs

Members
  • Posts

    135
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Bangalore

ranjuvs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Try this $string = "$5,000"; $string =preg_replace("/[^0-9]/","", $string); print $string; Regards Ranju
  2. Try this one <IfModule mod_rewrite.c> RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php </IfModule> Regards Ranju
  3. 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
  4. 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>
  5. 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
  6. Use mysql_fetch_object. In your code change the part $rows = mysql_fetch_row($result) to $rows = mysql_fetch_object($result)
  7. 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
  8. U can get that working with function ncode($str) { return $str; } but inorder to make your data safe, escaping is recommended.
  9. $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
  10. <?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>'; ?>
  11. 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];
  12. 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;
  13. use file system functions for this. http://in2.php.net/manual/en/ref.filesystem.php open a file and write the contents to the file
  14. 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].'";
  15. where you have defined the array $errorMsgDefinitionsArray?
×
×
  • 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.