Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Jaswinder

  1. Hi all The issue is, I want to show a map on google map site with marker on the location, when someone click on the link on my site. The problem is map is showing correctly, but no marker is there. Here is the link I am using <a href="https://www.google.com.au/maps/dir/-31.944951,115.803171">Map</a> Any help ?
  2. Hello friends, I am trying to achieve a simple thing, but I do not know jquery/javascript much. When I click on a forst list item in one div , I want to show corresponding 1st li in the second div. I have 6 list items in total and related 6 li in second div. Also when I click on any list item in first div, it will be borderd, this I achieved. But I am not able to bring the related li in the second div. Hope I make myself clear. Here is my code <style> .selected img { border:2px solid #090; } .visible { display:block; } .invisible { display:none; } </style> <div id="all"> <ul> <li class="selected"><img src="image1.JPG" /></li> <li><img src="image2.JPG" /><br /></li> <li><img src="image3.JPG" /><br /></li> </ul> </div> <div class="container"> <ul> <li class="visible"><img src="related_image1.JPG" /></li> (In these list items there may be img or content) <li class="invisible"><img src="related_image2.JPG" /></li> <li class="invisible"><img src="related_image3.JPG" /></li> </ul> </div> <script type="text/javascript"> $('#all ul li').on('click', function(){ $(this).addClass('selected').siblings().removeClass('selected'); $('.container ul li:nth-child(1)').fadeout(); // Don't know this line is correct or not }); </script> Any help guys ?
  3. Hi all Its my first project in CodeIgniter and I tried to make it live from local Issue is, In local server, site URI is running without index.php, but live it is giving error. e.g http://localhost/ci_basic/site/about folder name - ci_basic Controller name - site Function name - about In .htaccess file RewriteEngine On RewriteBase /ci_basic/ Now i uploaded the file in a folder named - chikabana ( folder in my root directory assigned to the chikabana.com ) In .htaccess file RewriteEngine On RewriteBase /chikabana/ I also changed the base url to - chikabana.com in config file and also removed index.php from config file. But this URL not working - http://chikabana.com/site/about this is working - http://chikabana.com/index.php/site/about Also my second question is - how i remove the controller name from url?
  4. Thanks for your suggestions. I started with codeIgniter as to have an understanding, how a framework works.
  5. Hi guys I am a php programmer and in a big confusion. I want to learn a framework, but can't figure out which one start ? CakePHP Codelgniter Symfony laravel I am new to them, so you can suggest me which one to start 1st and move on to other. Or If i miss any other framework , you can tell me that also. Any help is appriciable. Thanks
  6. Thanks kicken and Jacques1 Both of you helped me in learning new.
  7. Hey thanks for clearing me. i knew there are booleans but i need yes/no in my project
  8. thanks for reply, array_intersect_assoc() works But i am not clear, As you said - array_intersect() only checks values - not keys and here i am trying to compare the values only, and all values are different, so why i cant be able to use array_intersect() here ?
  9. Hi guys , Again i facing array comparison problem i got this after var_dump() $a and $b array(4) { ["q1"]=> string(3) "yes" ["q4"]=> string(2) "no" ["q3"]=> string(2) "no" ["q2"]=> string(2) "no" } array(4) { ["q1"]=> string(2) "no" ["q4"]=> string(3) "yes" ["q3"]=> string(3) "yes" ["q2"]=> string(3) "yes" } But when i use array_intersect($a,$b).. it results this array(4) { ["q1"]=> string(3) "yes" ["q4"]=> string(2) "no" ["q3"]=> string(2) "no" ["q2"]=> string(2) "no" } Don't know why, but there is no same value in both
  10. Hey thanks guys , i found why its coming, there were spaces in the value of my input fields and this is the most silly mistake i ever done.
  11. i tried var_dump() , and i found some problem array(3) { ["q1"]=> string(2) "no" ["q2"]=> string(10) " yes" ["q3"]=> string(10) " yes" } array(3) { ["q1"]=> string(2) "no" ["q2"]=> string(3) "yes" ["q3"]=> string(3) "yes" } After array_intersect() array(1) { ["q1"]=> string(2) "no" } Why it showing string(10), there is only 3 I think there is something messy in the value of input field
  12. Hi thanks for reply guys, nothing helping, I explain you what i am doing I entered some questions in database with answer yes or no After that i asked the same question from visitors and get their answer also .., then i compared them , Now in the same example , if i take some numeric values, instead of yes/no, the functions results correct i.e returning all the same values. i think character comparison is giving problem ? isn't it ?
  13. Hi i am trying to compare to arrays $a = Array ( [q1] => no [q3] => yes [q2] => yes ); $b = Array ( [q1] => no [q3] => yes [q2] => yes ); But when i intersect them it results in one element only, dont know why??? $c = array_intersect($a,$b); print_r($c); output - Array ( [q1] => no )
  14. I got your first point , there is no quoted string, so i will not use this function Regarding error handling, this is new to me, i will surf the web more for this, Thanks for bringing this thing in notice. Lastly, i was not trying to make empty table as error, just trying to print an error, if any occurred . This will also get clear after learning error handling Thanks a lot
  15. Thanks Jacques1 for reply and help me to improve my code. I started learning oops few days back, so there may be many mistakes. Firstly, mysqli_real_escape_string, i admit its of no use here , as no user input is there. Secondly, regarding errors, i want to display my own error messages , so i found this method comfortable This function is basically in a class in a separate file, so i am just returning result after fetching from database
  16. hey thanks for reply its working now , just removed the loop if($result->num_rows >0) { $f=$result->fetch_all(); return $f; }
  17. hi i am trying to fetch all my data from table here is the code function premiumview($cn,$table) { $table=mysqli_real_escape_string($cn,$table); $result=$cn->query("select * from $table"); if($result->num_rows >0) { while($f=$result->fetch_all(MYSQL_ASSOC)) { $result[]=$f; } return $result; } else { return $result=$cn->error; } } and the error is Fatal error: Cannot use object of type mysqli_result as array ( in while loop line ) What i am doing wrong?
  18. what is the volumeslider ?? you mentioned above
  19. can anyone tell me how this live editing is working. Is it javascript/jquery/ajax. i dont know exactly ,but i want to apply this on my website reference link - http://www.vistaprint.in/vp/ns/studio3.aspx?pf_id=AHT&combo_id=503945&referer=http%3a%2f%2fwww.vistaprint.in%2fgallery%2fILYBAAABAAAAAAA%3d%2fpremium-business-cards.aspx%3fxnav%3dHowToDesign&uei=397873&ag=true&ssc=1&filter=4%3a10003||1%2c3%3a10233||1&xnav=previews&xnid=button_113&rd=1
  20. Now i really pissed off, such a big mistake.. i really need break from coding thanks for correcting me
  21. Insert query not working insert into user(code) values('saafvjfjeklwvlk') where email='abc@yahoo.com' tablename - user column name - code error - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email='abc@yahoo.com'' Any idea ?
  22. Thanks @bsmither for nice answer. i works great @hakimserwa. thanks for your efforts too, but your ans is not giving the desired result.
  23. i want to convert multidimensional array to single array I am having this array array ( 0 => array ( 'sno' => 'q3', 'result' => '15', ), 1 => array ( 'sno' => 'q1', 'result' => '5', ), 2 => array ( 'sno' => 'q2', 'result' => '10', ), ) i want this resulting array array ( 'q3' => '15', 'q1' => '5','q2' =>'10' ) i tried foreach, but it gives the values (not an array ) like q3 15 q1 5 q2 10
  • 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.