heroic Newbie Poster

Hi! I am new to cakePHP, and have been trying to develop an application with it. While using cakePHP i created a model with these validation rules...

[CODE]var $validate = array(
'name' => array(
'rule'=>array('minLength', 1),
'message'=>'Name is required' ),
'email' => array(
'rule'=>'email',
'message'=>'Must be a valid email address' )
);[/CODE]

the controller goes as

[CODE]$this->inviteApply->set($this->data);
if($this->inviteApply->validates())
{
$this->inviteApply->save($this->data);
}
else
{
die();
}[/CODE]

Nw with this, according to all docuemntin and examples.. the data should be validated and errors should be reported... nthng like that seems to be happening...

hey thnx a lot mate! though it's not exactly what i am looking for, but it's surely helping! :)

any more help is appreciated!

heroic Newbie Poster

can i have a sample code of a c++ program that reads in a jpeg file, and with comments please, i am trying to learn image processing using jpeg file formats...

i would love to have advanced codes too, if any one of you can provide me with them.

i am going through some ebooks, but most deal with tiff, or no formats in details...

[CODE=PHP]<?
set_time_limit(0);
//set curl
$ch = curl_init();
$ckfile = "tmp/cookie.txt";
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_URL,'http://search.justdial.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$result=curl_exec ($ch);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_URL,'http://search.justdial.com/srch/all_indiasrch/all_india.php?page=1&companyname=a*&Allcity=All+India+Search');
curl_setopt($ch, CURLOPT_HTTPHEADERS,array('Host: search.justdial.com','Referer: http://search.justdial.com/srch/all_indiasrch/all_india.php'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$result=curl_exec ($ch);
preg_match('/>([0-9].?) Results for/',$result,$cnt);
$pages=$cnt[1];
preg_match_all('/javascript:showdetails_allindia(\'([\s\S\w\W].
?)\',\'([\s\w\S\W].?)\',\'sms\')/',$result,$details);
$i=0;
//foreach($details[1] as $i=>$v)
{
//post data to details page...
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_URL,'http://search.justdial.com/srch/search_cmd.php?srch=true&sms=undefined&city='.$details[2][$i].'&define=+&value=');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_COOKIE, 'CITY='.$details[2][$i].'; ShowCity=;');
curl_setopt($ch, CURLOPT_HTTPHEADERS,array('Host: search.justdial.com','Referer: http://search.justdial.com/srch/all_indiasrch/all_india.php?page=1&companyname=a
&Allcity=All+India+Search'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS,'city='.$details[2][$i].'&searchtype=&Stype=company&docId='.$details[1][$i].'&AllIndiaSearch=true&intermid=');
$result=curl_exec ($ch);
echo $result;
}
curl_close ($ch);
?>[/CODE]

heroic Newbie Poster

i need to access the detailed search result page using curl, but for some reason i am not able to do so... Please help!

The site is [url]www.justdial.com[/url] and i am searching for a* ... on the very first page there is a listing from banglore... i want to be able to access that using curl...

Thanx.

heroic Newbie Poster

i am trying to make a small search script, but i cannot get it to search for a particular keyword that may end in a space...

my input string is like...

amit qby:name hello

i want the preg_match to gimme qby:name

another input string can be

amit qby:name

i can get it to work for only one of the cases.. plz help...

that is to show stuff in browser... i am looking to show stuff in a msn or gtalk like status bar popup...

heroic Newbie Poster

Hello, i am trying to create gmail like alerts in visual c++ which will show information fetched from a php file on the internet, and will be able to send the current;y playing song to the php script...

any help is really welcome!

if dat doesn't work, i can try n fix it for you...

PS i am a pro php programmer :P

change

[icode]document.write( '<a ' + path + '\'' + prefix + ':' + addy27400 + '\'>' ); document.write( addy27400 ); document.write( '<\/a>' );[/icode]

to
[icode]document.write( addy27400);[/icode]

that should do it!