Jump to content

mdvignesh

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by mdvignesh

  1. public function editContact( $c_id = null ) { //echo $c_id; if( !$c_id ) { throw new NotFoundException( __( 'Invalid Post' ) ); } $contact = $this->Contact->findBycId( $c_id ); if( !$contact ) { throw new NotFoundException( __( 'Invalid Post' ) ); } //$id = $c_id; if( $this->request->is( array( 'post', 'put' ) ) ) { $this->Contact->cid = $c_id; if( $this->Contact->save( $this->request->data ) ) { $this->Session->setFlash( __( 'Data Updated' ) ); return $this->redirect( array( 'action' => 'index' ) ); } $this->Session->setFlash( __( 'Unable To update Data!' ) ); } if( !$this->request->data ) { $this->request->data = $contact; } } edit action in my controller in my contacts table I'm having 'c_id' instead of 'id' I also add this public $primaryKey = 'c_id' in Contact.php model file But still I get column not found unknown column contact.id in where clause
  2. I am doing Photo gallery using cakephp and flickr by seeing this link http://www.sitepoint.com/photo-gallery-cakephp-flickr/# I am getting Error: Class 'phpFlickr' not found File: C:\wamp\www\cake\app\Controller\Component\flickrComponent.php Line: 28 This is my flickrComponent.php <?php /** * Flickr Component * @author RosSoft * @license MIT * @version 0.1 */ define(‘FLICKR_CACHE_DIR’,CACHE . ‘flickr/’); class FlickrComponent extends Object { /** * Api Key. Change to your own * @var string * @link http://www.flickr.com/services/api/misc.api_keys.html */ //var $_api_key=’CHANGE_TO_YOUR_KEY’; var $_api_key='55d16262ee69f739466b7c45b073cc8a'; function startup(&$controller) { App::import('Vendor', 'phpFlickr', array('file' => 'phpflickr'.DS.'phpFlickr'.DS.'phpFlickr.php')); //vendor(‘phpflickr/phpFlickr’); //FlickrComponent instance of controller is replaced by a phpFlickr instance $controller->flickr =& new phpFlickr($this->_api_key); if (!is_dir(FLICKR_CACHE_DIR)) { mkdir(FLICKR_CACHE_DIR,0777); } $controller->flickr->enableCache(‘fs’, FLICKR_CACHE_DIR); $controller->set(‘flickr’,$controller->flickr); } } ?> This is my gallerycontroller.php <?php class GalleryController extends AppController { var $name = 'Gallery'; var $components = array('Flickr'); var $uses = null; } ?>
  3. I created a password in wamp server than i added that password in new mysqli("localhost","root","beam","lms") Now iam getting error : Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user ''@'localhost' (using password: NO) in on line 169 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in on line 169 (Before having password thatis without password it was working good)
  4. Thank u very very much. php freaks is the GOD :D
  5. I dont know y if else not working my questions is when i type username in the database it displays username exists but if type something else it does not displays the else part in the if statement signup.php <? include("db.php")?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> function valid() { var un=document.forms[0].dun.value; //alert(un); if(un=="") { alert("Enter username"); document.forms[0].dun.focus(); return false; } var ps=document.forms[0].pass.value; if(ps=="") { alert("Enter password"); document.forms[0].pass.focus(); return false; } var mail=document.forms[0].em.value; if(mail=="") { alert("Enter email"); document.forms[0].em.focus(); return false; } var mobile=document.forms[0].mob.value; if(mobile=="") { alert("Enter mobile"); document.forms[0].mob.focus(); return false; } } </script> <script src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#feedback').load('chech.php').show(); $('#username_input').keyup(function() { $.post('chech.php',{ dun:form.dun.value }, function(result) { $('#feedback').html(result).show(); }); }); }); </script> </head> <body> <form name="form" method="post"> <label>Desired Username:</label> <input type="text" id="username_input" name="dun"><div id="feedback"></div> <br><br> <label>Password:</label> <input type="password" name="pass"><br/><br/> <label>Confirm:</label><input type="password" name="pass2"> <br><br> <label>Email:</label> <input type="text" name="em"> <br><br> <label>Mobile:</label> <input type="text" name="mob"> <br><br><br> <input type="submit" name="sub" value="signup" onClick="return valid();"> </form> <? if(isset($_REQUEST['sub'])) { $ins=mysql_query("insert into reg (username ,password ,email ,mobile) values ('".$_REQUEST['dun']."' ,'". $_REQUEST['pass']."','".$_REQUEST['em']."','".$_REQUEST['mob']."') "); if(!$ins) { echo "error"; } else ?> <a href="login.php">Login</a> <? } ?> </body> </html> chech.php <? include("db.php"); if(isset($_POST['dun'])) { //echo $_REQUEST['dun']; $sel=mysql_query("select username from reg where username='".$_REQUEST['dun']."' "); $count=mysql_num_rows($sel) or die(mysql_error()); echo $count; if($count>0) { echo "username exists"; } else echo "not exists"; } ?>
  6. here is the code $(".newsticker-jcarousellite2").jCarouselLite({ horizontal: true, hoverPause:true, visible: 3, auto:5000, speed:1000, btnNext: ".prev", btnPrev: ".next" });
  7. On page load the jcarousellite comes vertically and after that it comes correctly I want to load horizontally the jcarousellite slide I downloaded from here http://www.htmldrive.net/items/show/397/Vertical-Scrolling-News-Ticker-With-jQuery-jCarouse and modified horizontal:true How to do that see this http://cineaxis.com/
  8. Facebook share fetches all pictures from my site when i click the button which i get from addthis.com I found one solution but i dont know how to use it - <meta tag> in head tag See this link http://www.cineaxis.com/news-details.php?id=451
  9. how to use foriegn key in insert query I am having a comment form for each video like youtube having 2 tables one for video details and one for comments insert into cae_comments (c_id,comments_date,comments,approve_com) values ('".$_REQUEST['id']."','".date("Y-m-d")."' ,'".trim($_POST['txtarea'])."',NULL) i set c_id as foreign key and primary key v_id in 2nd table
  10. on page load pop up comes for selecting tv or movies (session is started in conn.php) if tv is selected session['select'] = 'tv_sotime' same for movies Now i want to change the selection I kept a link 'CHANGE' for selection i will unset session['select'] by passing variable on session.php but when i load /entertainment.php the pop up should not come Thank U... index.php <? include("conn.php"); //require('_drawrating.php'); $pagename="Entertainment"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?=$settings->ScriptName?> | <?=$pagename?></title> <link rel="shortcut icon" href="images/favicon.ico" /> <link rel="shortcut icon" type="images/png" href="images/favicon.png" /> <link rel="shortcut icon" type="images/png" href="images/favicon.gif" /> <link rel="stylesheet" href="style.css" type="text/css" media="all" /> <link rel="stylesheet" href="css/cnelstyle.css" type="text/css" media="all" /> <link media="screen" rel="stylesheet" href="css/colorbox.css" /> <script src="js/jquerylatestmin.js" type="text/javascript"></script> <script src="js/jquery.colorbox-min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $(window).bind('load', function(e) { $.colorbox({ 'width' : 300, 'height' : 130, 'transitionIn' : 'none', 'transitionOut' : 'elastic', 'centerOnScroll' : 'true', 'overlayOpacity' : 0.2, 'overlayColor' : '#000', 'modal' : 'true', href:"select.php"}); }); }); </script> </head> <body> <? //require_once("fb.php")?> <div id="wrap"> <? include('header.php'); include("session.php"); ?> <div class="wraper"> <div class="middle"> <div class="ad"><?=stripslashes($adsense->Ads7)?></div> </div> <div class="clr"></div> </div> </div> <div class="footer"> <div class="wraper"> <?php include("footer.php"); ?> </div> </div> </body> </html> tv_sotime.php <?php include("conn.php"); $pagename="TV SHOWTIME"; $_SESSION['select'] = 'tv_sotime'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> <?=$settings->ScriptName?> | <?=$pagename?> </title> <link rel="shortcut icon" href="images/favicon.ico" /> <link rel="shortcut icon" type="images/png" href="images/favicon.png" /> <link rel="shortcut icon" type="images/png" href="images/favicon.gif" /> <link rel="stylesheet" href="css/cnelstyle.css" type="text/css" media="all" /> <link rel="stylesheet" href="style.css" type="text/css" media="all" /> <link rel="stylesheet" href="jscss/main.css" /> <script type="text/javascript" src="jscss/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="jscss/main.js"></script> </head> <body> <? //include("customjqmodalbox.php"); require_once("fb.php"); ?> <div id="wrap"> <? include('header.php')?> <div class="wraper"> <div class="middle"> <div class="middle_content"><a href="session.php?curr=c">Change</a></div> <div id="page"> <ul class="mytabs" id="tabs"> <li class="title"> <h2><strong>What's on Today?</strong></h2> <? //date('l M d Y')?> </li> <!-- <li class="todaydate"> <h2></h2> </li>--> <li class="current"><a href="tab-1.html">Movies</a></li> <li><a href="tab-2.html">Reality</a></li> <li><a href="tab-3.html">Sports</a></li> </ul> <div class="mytabs-container" id="tabs-container"> Loading... </div> </div> <!-- page --> <div class="ad"> <?=stripslashes($adsense->Ads7)?> </div> <div class="ss"> <h3 id="cat_head">Categories</h3> <ul> <li><a href="#">Drama</a></li> <li><a href="#">TV Programs</a></li> <li><a href="#">Special Programs for special Day</a></li> </ul> <img src="images/cineaxis.png" alt="" /> </div> </div> </div> <div class="clr"></div> </div> </div> <!-- warp --> <!--<div class="fb-like-box" data-href="http://www.facebook.com/CineAxis" data-width="198" data-height="274" data-show-faces="true" data-border-color="#E8E8E8" data-stream="false" data-header="false"> </div>--> <div class="footer"> <div class="wraper"> <?php include("footer.php"); ?> </div> </div> </body> </html> <? include("conn.php"); //session_start(); if(isset($_GET['curr']) == 'c') { unset($_SESSION['select']); //session_destroy(); header("Location:index.php"); } if(isset($_SESSION['select'])) { if($_SESSION['select'] == 'tv_sotime') { $page = 'tv_sotime.php'; header("Location:$page"); } if($_SESSION['select'] == 'movie_sotime') { $page2 = 'movie_sotime.php'; header("Location:$page2"); } } ?>
  11. i want a page with alert on page load for selecting country background click must be disabled and escape key should be disabled
×
×
  • 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.