‘web development’ Archives
integrate window media player in your website
<html> <head></head> <body leftmargin="0" topmargin="0"> <table cellpadding="0" cellspacing="0" border="0"> <tr height="350"><td align="center"> <table cellpadding="0" cellspacing="0" border=1 bordercolor="black"> <tr> <td valign="top"> <OBJECT ID="MediaPlayer" WIDTH="320" [...]
update query in symphony (Method 2)
For example to execute query like UPDATE tableName SET column1 = 'abc',column2 = 'xyz' WHERE column ='1'; In symfony you can do it this way $c = new Criteria(); $c->add(MyTablePeer::COLUMN,1); $c->add(MyTablePeer::COLUMN1,'abc'); $c->add(MyTablePeer::COLUMN2,'xyz'); MyTablePeer::doUpdate($c); Thanks
Show tooltip on mouseover
Step 1: Copy this css style code into your header tage right before the end of header tag <style type="text/css"> #dhtmltooltip{ position: absolute; border: 1px solid red; width: 150px; padding: 2px; background-color: lightyellow; visibility: hidden; z-index: 100; filter: [...]
Sorting a two dimensional array in javascript
function sortArray(x,y) { return ((x < y) ? -1 : ((x > y) ? 1 : 0)); } var givenarr = ,,]; givenarr.sort(sortArray); ======================== The result array will be givenarr = ,,];
update query based on condition
$con = sfContext::getInstance()->getDatabaseConnection('propel'); $c2 = new Criteria(); $c2->add(TblTopPeer::TF_ZIPCODE,$topForecastInfo->getForZipcode()); $c2->add(TblTopPeer::TF_FORCASTDATE,$topForecastInfo->getForForecastdate()); $c3 = new [...]
How to apply or condition for mysql query in symfony
$cs = new Criteria(); $criterion = $cs->getNewCriterion(HfArticlesPeer::AR_DESCRIPTION,'%'.$searchText.'%',Criteria::LIKE); $criterion->addOr($cs->getNewCriterion(HfArticlesPeer::AR_TITLE,'%'.$searchText.'%',Criteria::LIKE)); $criterion1 = [...]
No connection params set for propel
When you are using symfony framework , and when you get the error as "No connection params set for propel" ,Do the following changes . In config /databases.yml file Replace all: propel: class: sfPropelDatabase param: datasource: symfony dsn: mysql://root:@localhost/mywebsite with all: propel: class: sfPropelDatabase param: phptype: [...]
how to create html element dynamically in javascript
var itemManCnt=2; function addMoreHomeImage() { if(itemManCnt==6) { alert("You can upload only 5 files"); return false; } var parentObj=document.getElementById('FileElementItem'); var divClrBoth = document.createElement("div"); divClrBoth.setAttribute("class","ClrBoth"); divClrBoth.setAttribute("id",itemManCnt); var divClrSelect = [...]
file type validation in javascript
function isValidfile(filename) { file_value = filename; var checkfile = file_value.toLowerCase(); if (!checkfile.match(/(\.doc|\.DOC|\.pdf|\.PDF)$/)) { return false; } else { return true; } }
image validation in javascript
function isValidImage(imagename) { imagefile_value = imagename; var checkimg = imagefile_value.toLowerCase(); if (!checkimg.match(/(\.jpg|\.gif|\.png|\.JPG|\.GIF|\.PNG|\.jpeg|\.JPEG)$/)) { return false; } else { return true; } }
PHP Manual