Search Results

Search found 16 results on 1 pages for 'salmane'.

Page 1/1 | 1 

  • multi word query in mysql

    - by salmane
    Hi there , in order to make things easier for users i want to add multiple keyword search to my site. so that in the input the user would do something like : " keyword1 keyword 2" ( similar to google for example. would i need to write a code that would parse that string and do queries based on that or is there something built in mysql that could do it?

    Read the article

  • jquery element filter by css

    - by salmane
    I would like to select every div that has a red background color for example. is this possible in jquery? <div style="background-color:red"></div> <div style="background-color:white"></div> <div style="background-color:red"></div> <div style="background-color:yellow"></div> thank you

    Read the article

  • javascript add prototype method to all functions?

    - by salmane
    Is there a way to add a method to all javascript functions without using the prototype library? something along the lines of : Function.prototype.methodName = function(){ return dowhateverto(this) }; this is what i tried so far but it didnt work. Perhaps it is a bad idea also if so could you please tell me why? if so can I add it to a set of functions i choose something like : MyFunctions.prototype.methodName = function(){ return dowhateverto(this) }; where MyFunctions is an array of function names thank you

    Read the article

  • facebook authentication / login trouble

    - by salmane
    I have setup facebook authentication using php and it goes something like this first getting the authorization here : https://graph.facebook.com/oauth/authorize?client_id=<?= $facebook_app_id ?>&redirect_uri=http://www.example.com/facebook/oauth/&scope=user_about_me,publish_stream then getting the access Token here : $url = "https://graph.facebook.com/oauth/access_token?client_id=".$facebook_app_id."&redirect_uri=http://www.example.com/facebook/oauth/&client_secret=".$facebook_secret."&code=".$code;" function get_string_between($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } $access_token = get_string_between(file_get_contents($url), "access_token=", "&expires="); then getting user info : $facebook_user = file_get_contents('https://graph.facebook.com/me?access_token='.$access_token); $facebook_id = json_decode($facebook_user)->id; $first_name = json_decode($facebook_user)->first_name; $last_name = json_decode($facebook_user)->last_name; this is pretty ugly ( in my opinion ) but it works....how ever....the user is still not logged in...because i did not create or retrieve any session variables to confirm that the user is logged in to facebook... which means that after getting the authentication done the use still has to login .... first: is there a better way using php to do what i did above ? second: how do i set/ get session variable / cookies that ensure that the user doesnt have to click login thanks for your help

    Read the article

  • twitter oauth must authorize user everytime they login

    - by salmane
    I am adding twitter oauth login to my site . and so far i got it to work using oauth. however every time i login i go through the whole authorization process. ( the prompt that allows the user to request or deny the application) is there a way to by pass that once the user has authorized the app? Perhaps i am misunderstanding the process also if so could you please clarify? thank you

    Read the article

  • parsing through html with php

    - by salmane
    while working on facebook connect I have to retrieve an access token from a url ( it is not in the url itself but in the file lined to that url) so this is what I do $url = "https://graph.facebook.com/oauth/access_token?client_id=".$facebook_app_id."&redirect_uri=http://www.example.com/facebook/oauth/&client_secret=".$facebook_secret."&code=".$code;" function get_string_between($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } $access_token = get_string_between(file_get_contents($url), "access_token=", "&expires="); it looks ugly and clumsy is there a better way to do it ? thank you .

    Read the article

  • IE 7 does not like jquery('<button/>').attr('type','button')

    - by salmane
    I am trying to create a button using jquery. I use the following code jquery('<button/>', {type:'button'}).text(name) However this works in Safari , FF IE8 but not IE7 i tried to use the attr function : jquery('<button/>').attr('type','button').text(name) this does not work either. any ideas what would work? I suppose if I don't assign a type it would default to button but i rather do that thanks for your help

    Read the article

  • basic javascript DOJO 1.4 installation not working

    - by salmane
    I am trying to give the DOJO framework a test spin but some how the latest release does not work at all ( 1.4.2) I keep getting a "console[_8]" [undefined] is not an object error. this is on the demos as well 1.3.3 works fine it seems ( or at least i dont get that error so far) any ideas? I have been using jquery for a while and love it , just looking for something better i guess. does anyone recommend DOJO? thanks

    Read the article

  • Semantics of setting cookies and redirecting without getting header error

    - by salmane
    I would like to do the following in php : setcookie('name', $value, $Cookie_Expiration,'/'); then some action header("location:http://www.example.com") the problem is that I get : warning: Cannot modify header information - headers already sent by (...etc ) could you please let me know what i am doing wrong and if there is a way to do this? by the way , this code is before any output is made ...the cookie setting part works fine on its own and so does the redirection code....the combination fails thank you

    Read the article

  • php symantics of setting cookies and redirecting without getting header error

    - by salmane
    I would like to do the following in php : setcookie('name', $value, $Cookie_Expiration,'/'); then some action header("location:http://www.example.com") the problem is that I get : warning: Cannot modify header information - headers already sent by (...etc ) could you please let me know what i am doing wrong and if there is a way to do this? by the way , this code is before any output is made ...the cookie setting part works fine on its own and so does the redirection code....the combination fails thank you

    Read the article

  • php extracting complete url with variables

    - by salmane
    Hi there, Using Php I would like to extract the current Url of a page including all variables attached to it. $_SERVER['PHP_SELF'] only return the url without the variable . any idea what function I need. example : www.site.com/?v1=xyz&v2=123 using $_SERVER['PHP_SELF'] I get only : www.site.com as opposed to the whole url. using $_GET[] individually is not an opton since I am not sure what variable are attached to the URL. thank you

    Read the article

  • jquery cousin element

    - by salmane
    I am trying to locate the closest element that contains a class....this is in an effort to find the "cousin" of the current element that i have.. the following did not work : $('myelement').closest ('*:has(.class1)').find('class_cousin') I am using the * in closest since i am not sure what type element is the one i am looking for nor do I know if it has any classes or ID ( i am trying to keep it general for a plugin) any idea how I could do it? thank you

    Read the article

  • how to use jquery index()

    - by salmane
    I am trying to find the index of the following element <ol id="parent"> <li><a></a></li> <li><a class="index_of_this"></a></li> <li><a></a></li> <li><a></a></li> </ol> But I keep getting -1 $('#parent a.index_of_this') thank you for your help

    Read the article

  • mysql extra columns with same name from two tables

    - by salmane
    Table 1 has columns : entry_id user_id ... Table 2 has columns : entry_id user_id ... the user_id entry is not always the same so I would like to extract both of them so I can later on compare them in my script SELECT * FROM table1 as t1 INNER JOIN table2 as t2 on t1.entry_id=t2.entry_id WHERE t1.user_id='%s' I would like to extract t1.user_id and t2.user_id ...the problem is the result array has only user_id thank you

    Read the article

1