< Buzzing or vibrating the login form using jquery Posted On May 15, 2012 : 0 comments << >> Simple div slideshow using jquery Posted On May 9, 2012 : 0 comments << >> Copy mysql column in varchar to type date Posted On May 3, 2012 : 0 comments << >> Enter only numbers inside a input field of a form using javascript Posted On May 1, 2012 : 0 comments << >> Slide in and out animate div vertically using jquery Posted On April 25, 2012 : 1 comment << >> Tag cloud using php, mysql and ajax with filter Posted On April 24, 2012 : 0 comments << >> Change webpage font color or background color from the user side using javascript Posted On April 19, 2012 : 0 comments << >> A single link that cycles through several webpage background color using javascript Posted On April 17, 2012 : 0 comments << >> Simple webpage redirection using perl script Posted On April 10, 2012 : 0 comments << >> Get ipaddress using perl script Posted On April 4, 2012 : 0 comments << >>

Get Method and Array Manipulation In Symfony

This Tutorial Has Been Viewed 1,538 Times.
VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)

Below is the action.class.php code for the success page named playlistSuccess.php,

here i am getting the values of mob0,mob1 etc., to mob7 from the address bar of browser that is we

are using the get method.The browser address bar contains something like this
http://localhost/frontend_dev.php/playlist/playlist?mob0=8761&mob1=8763&mob2=8764&mob3=8765&mob4=8773&mob5=8774&=8775&mob7=8901 From the code below i am getting all the values from the browser address bar and all of them are inserted in to an array named DATA.Then using FOREACH i just extracted the values and using the criteria i connected the database to the field name FILE where ID is the value that i get from the DATA array.The OUT variable has all the values we want and from that using FOREACH i once again extracted the correct values of each array in to MYDATA.This MYDATA has values of different fields of the TABLE FILE.

Then all the data that i want is now in the RESULTARRAY.


public function executePlaylist()

{

$this->a =$this->getRequestParameter('mob0');

$this->b =$this->getRequestParameter('mob1');

$this->c =$this->getRequestParameter('mob2');

$this->d =$this->getRequestParameter('mob3');

$this->e =$this->getRequestParameter('mob4');

$this->f =$this->getRequestParameter('mob5');

$this->g =$this->getRequestParameter('mob6');

$this->h =$this->getRequestParameter('mob7');

$data=array("$this->a", "$this->b", "$this->c", "$this->d", "$this->e" , "$this->f" ,"$this->g" , "$this->h");

$resultArray = array();

//print_r($data);

foreach($data as $val)
{

$cr = new Criteria();

$cr->add(FilePeer::ID,$val);

$this->out = FilePeer::doSelect($cr);
//another criteria
//echo $val;
foreach($this->out as $mydata){
// echo '<br />'.$mydata->getUserid();
// echo '<br />'.$mydata->getId();
//echo '<br />'.$mydata->getOrginalpath();
//echo '<br />'.$mydata->getCaption();
$resultArray[]=array( $mydata->getUserid(), $mydata->getId(), $mydata->getOrginalpath(), $mydata->getCaption(), $mydata->getDate());

}
}

$this->resultArray = $resultArray;
}

In the playlistSuccess.php page i am just outputting an XML file which i want to connect dynamically to my AUDIO PLAYER(THIS IS MY REQUIREMENT YOU CAN OUTPUT TO ANY XML FORMAT YOU WANT).

< ?php
echo '<?xml version=\"1.0\" encoding=\"UTF-8\" ?><songs>';foreach ($resultArray as $result){
$id = $result[0];
$mainid = $result[1];$title = $result[2];

$author = $result[3];
$date =$result[4];

$comma= '"';

echo "<song path=".$comma."$title".$comma. " bild=".$comma."http://s3.amazonaws.com/tutorialz/100×100/$id".$comma." artist=".$comma."$id".$comma." title=".$comma." $author".$comma."/>\r\n";

}

echo "</songs>";
?>
VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)

Incoming search terms:





You will also be interested in ,

Tags: , , ,

Leave a Reply

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks