Jump to content

rubahfgouveia

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rubahfgouveia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It worked like a charm! p.s: I've looked into heredoc, and it seems much more practical . Thanks mate!
  2. Hey guys, I'm trying to echo the following DIV: echo '<div class="event3" style="width:' $test[0] ' ">;' where $test[0] is a certain value (200 , 400 , etc), but it's not working.. Does anyone know how to I call the variable inside the DIV? Thanks alot, RĂºben Gouveia
  3. Hey all, I am building a graph, and since my programming skills aren't the best, and I would really appreciate some help... The y axis values in my graph are always numbers like : '0.30222222' , '0.31212202' , etc... What I would like to build is a cycle(?!), that goes through the number, searching for 0's, printing out a different message according to the position where the 0 is. something like this: for (cycle through this.y) { if (finds a 0 in the first position of this.y) { return 'a' } if (finds a 0 in the second position of this.y) { return 'b' } if (finds a 0 in the third position of this.y) { return 'c' } }
  4. Hey all, I've been using Eric Martin's simple modalbox: (http://www.ericmmartin.com/projects/simplemodal/ . It works fine, but currently the modalbox is being triggered with two methods (button or href click): <input type='button' name='osx' value='Demo' class='osx demo'/> <a href='#' class='osx'>Demo</a> I needed the modalbox to be triggered without a user click (onpageload). Is there a way of "faking" a user click on a button or href? Thanks, Ruben
  5. worked as a charm. Thanks alot
  6. Hey all, I have the following code: <? $result = mysql_query("SELECT A,B FROM USS"); $num_rows = mysql_numrows($result); for($i = 0; $i < $num_rows; $i++) { $nome_utilizador = mysql_fetch_row($result); $user = $nome_utilizador[0] . " ". $nome_utilizador[1]; $teste[] = $user; } ?> Currently me array is filled in the following way : $array[] -> [aaa,bbb,ccc]; but what I need is it to fill up with the "" wrapped around each entry : $array[] -> ["aaa","bbb","ccc"]; . I know json_encode does something like what I need, but I'm not sure how to echo each element of a json_encode.. I would really appreciate the help. Thanks alot, Ruben
  7. sorry, got it. it was really easy <SCRIPT> function openwindow() { window.open("example.jpg","menubar=1,resizable=1,width=350,height=250"); } </SCRIPT> <A href="javascript: openwindow()">Open File</A>
  8. Hey all, my doubt is the following: Is there a way of opening files (images,pdf's,etc) in a popup window? What I intend to do, is have a button, that when pressed, would acess and open certain files in a popup window. I already know how to acess and download the files, but I would like to know how to open them inside the browser. sorry for the bad English. Hope you understood and can help. Thanks alot, Ruben
  9. Hey, having some troblems using the readfile function.. I have the following code. I want to download the file "blabla.gif", but the file is in a certain directory (let's say: "/ExampleFile/Files/" . How do I set the path to "/ExampleFile/Files/" ? $file ='blabla.gif'; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); exit; } Thanks, Ruben
  10. Hey, The solution you sent me won't really work, because I need the var in the following format: var contacts = [{name:"<? echo $teste[0]?>",email:"ccc@ddd.com"}, {name:"<? echo $teste[1]?>",email:"fff@ccc.com"}, ]; // etc, until the cycle stops In other words, the solution you gave me would provide something like: var contacts = ["value_1","value_2"] //etc When what I need to recieve in the var is: var contacts = [ {name:"value_1",email:"whatever@whatever.com"},{name:"value_2",email:"whatever2@whatever2.com"}] //etc Thanks, Ruben
  11. Hey all, What I want to do is send an array of PHP values into a variable I created in Javascript. PHP code: <? $result = mysql_query("SELECT A,B FROM USS"); $num_rows = mysql_numrows($result); for($i = 0; $i < $num_rows; $i++) { $nome_utilizador = mysql_fetch_row($result); $user = $nome_utilizador[0] . " ". $nome_utilizador[1]; $teste[] = $user; } ?> Then, right after this PHP code, i have the following JS code: <script type="text/javascript"> var contacts = [ {name:"<? echo $teste[0]?>",email:"ccc@ddd.com"}, {name:"fff",email:"fff@ccc.com"}]; </script> I managed to get one value printed into the var, but what I want is to create a cycle, inside the JS code, that would get all the values from my $teste[] array, and print it into the var I created. Hope I made myself explicit Thanks, Ruben
  12. works just fine sorry for bothering.. I was already expecting the worse Cheers, and thanks
  13. Hello all, I'm really new in JS and I was wondering if it's possible to get a PHP variable, and use it inside JS. for example: <? $x = 7; ?> <script> teste.funct = function (e) { var fff = new G.P('myc3',[<?php echo "$x"?>,3,5,6,2,1,4]); } </script> something like that..
  14. sorry to bother again: Now i'm trying to do a querie with the values from the array, but its not getting the (${$test}[$x]) values. Do i have to change the syntax again? $resultado = mysql_query("SELECT DISTINCT * FROM Curso WHERE Curso.Nome_Curso = '${$test}[$x]'");
×
×
  • 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.