Jump to content

felito

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

felito's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi This works to check the name attribute: <input type="hidden" name="submitted" value="TRUE" /> //On HTML Page if(isset($_POST['submitted'])) //PHP Check And if I want to check by id or class? thanks
  2. this solve my problem. http://jsfiddle.net/X9uvK/ thanks
  3. hi I am trying this code, but apparently something is wrong: <a class = "perfil_1"><h3>Luciana</h3> </a> <a class = "perfil_2"><h3>Luciana</h3></a> <a class = "perfil_3"><h3>Luciana</h3> </a> <div id="dialog_1"> <p>Lorem ipsum dolor sit amet</p> </div> <div id="dialog_2"> <p>Lorem ipsum dolor sit amet</p> </div> <div id="dialog_3"> <p>Lorem ipsum dolor sit amet</p> </div> for (var i = 1; i <= 4; i++) { $('#dialog_' + i).dialog({ autoOpen: false, show: "slide", hide: "explode" }); $('.perfil_' + i).on("click", "h3" , function () { $('#dialog_'+i).dialog('open'); return false; }); } http://jsfiddle.net/JbFZD/ > any idea?
  4. This is a simple demo about my problem. I need to access the id_user in main.js file. My question is, how to avoid global variables in this situation? It is bad practice use global variables for this purpose? main.js require({ paths : { jQuery : 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min' } }); require([ 'jQuery' ], function() { alert(id_user); }); index.php <script data-main="js/main" src="js/require.js"></script> <script type="text/javascript"> function users() { id_user = <?php echo $id; ?> } users(); </script>
  5. yes, random or ordered alphabetically. This query is more difficult than I thought. :-\ thanks
  6. To clarify. I have this structure: table users id_user username update_photo 1 Pedro photo 2 Joao photo 3 Carlos photo 4 José photo 5 António photo 6 Toni photo table lists id_lists name_list users_id_user 1 primeira_lista 9 // owner of the list 2 segunda_lista 9 // owner of the list table lists_has_users users_id_user lists_id_lists 1 1 - first 2 1 - second 3 1 -------- 4 2 - first 5 2 - second 6 2 -------- The outuput that I want is: 1 Pedro photo 2 Joao photo 3 Carlos photo 4 José photo 5 António photo 6 Toni photo My idea is a sample of two members of each list. If the user want to see more members he can click in view more button that will open a new page with all members of this list. Did you understand what i mean?
  7. I am trying this code, that works well. SELECT U.username, U.update_photo FROM users U INNER JOIN lists_has_users H ON U.id_user = H.users_id_user INNER JOIN lists L ON L.id_lists = H.lists_id_lists WHERE L.users_id_user = ? Now the problem. This query will select all the users of the lists. What i want is limit the number of output members by list. For example, two members by each list (id_lists). Any idea? thanks
  8. thanks to all. The main problem is that the order of the index is not the natural. array 0 => array 0 => int 1 1 => string 'A' (length=1) 2 => string 'B' (length=1) 3 => string 'C' (length=1) 1 => array 1 => int 1 2 => string 'D' (length=1) 3 => string 'E' (length=1) 2 => array 2 => int 1 3 => string 'F' (length=1) is different of: array 0 => array 0 => string 'A' (length=1) 1 => string 'B' (length=1) 2 => string 'C' (length=1) 1 => array 0 => string 'D' (length=1) 1 => string 'E' (length=1) 2 => array 0 => string 'F' (length=1) this solves the issue, but i have problems with the ceil in some cases. $nArr = array('A', 'B', 'C', 'D', 'E', 'F'); $lp = 3; for ($i = 0; $i < $lp; $i++) { $m[$i][$i] = 1; for ($x = $i; $x < $lp; $x++) { $v = $i+ceil($i/2); $m[$i][$x+1] = $nArr[$x+$v]; } }
  9. Well, as i said, i need this structure: array 0 => array 0 => int 1 1 => string 'A' (length=1) 2 => string 'B' (length=1) 3 => string 'C' (length=1) 1 => array 1 => int 1 2 => string 'D' (length=1) 3 => string 'E' (length=1) 2 => array 2 => int 1 3 => string 'F' (length=1) How ksort can be useful?
  10. I have this code $nArr = array('A', 'B', 'C', 'D', 'E', 'F'); $counter = 3; while ($counter > 0) { $chunkedValues[$counter][0] = 1; for ($j = 0 ; $j < $counter ; $j++) { $chunkedValues[$counter][$j + 1] = $nArr[$j]; } $nArr = array_slice($nArr, $counter--); } var_dump($chunkedValues); that outputs: array 3 => array 0 => int 1 1 => string 'A' (length=1) 2 => string 'B' (length=1) 3 => string 'C' (length=1) 2 => array 0 => int 1 1 => string 'D' (length=1) 2 => string 'E' (length=1) 1 => array 0 => int 1 1 => string 'F' (length=1) But i need this index structure: array 0 => array 0 => int 1 1 => string 'A' (length=1) 2 => string 'B' (length=1) 3 => string 'C' (length=1) 1 => array 1 => int 1 2 => string 'D' (length=1) 3 => string 'E' (length=1) 2 => array 2 => int 1 3 => string 'F' (length=1) I want to avoid loops with ceil. Any idea? thanks for your time.
  11. should be $str and count($arr_tags);. Anyway, the problem is not that.
  12. hi What is the correct way to do a function like: public function check_($db, $skills) { $arr_tags = array('16', '17', '36', '546'); $z = implode(', ', array_fill(0, count($arr_tags), '?')); $str = implode('', array_fill(0, count($arr_tags),'s')); $par = "'" . implode("','", $arr_tags) . "'"; $c_arr_tags = count($arr_tag); $sql = $db -> prepare(" SELECT offer_id_offer FROM offer_has_tags WHERE tags_id_tags IN ($z) GROUP BY offer_id_offer HAVING COUNT(*) = ? "); $sql -> bind_param("$srt.'i'", $par, $c_arr_tags); $sql -> execute(); $sql -> bind_result($id_offer); return $id_offer; } At the moment i got: Number of elements in type definition string doesn't match number of bind variables
  13. I am trying to use jquery to load a dojo chart. I am using this code. However in the second click, in the first button i get this error. The same occurs if i click in the first button, click in the second and click again in the first. This problem is Driving me crazy. http://i.stack.imgur.com/5ZmtM.jpg demo here http://74.52.141.77/~dnsmont/test1/ <script type="text/javascript"> $(document).ready(function () { $('.lista_').click(function () { $.get('index1.php', function (data) { dojo.addOnLoad(function () { require(["dojo/_base/xhr", "dojo/parser", "dojo/dom"], function (xhr, parser, dom) { var um = []; dijit.registry.filter(function (w) { //problem here, maybe this code destroy something that should not be destroyed if (dojo.indexOf(um)) { w.destroyRecursive(); } }); $('#paginas').html(data); dojo.parser.parse(dojo.byId('paginas')); }); }); }); }); }); </script>
  14. hi This var_dump give me false. So, my question is why this url is not valid ? thanks link http://00.00.000.00/~dnsmont/login/?se=home $url=$_SERVER['REQUEST_URI']; var_Dump(filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED | FILTER_FLAG_QUERY_REQUIRED));
×
×
  • 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.