Jump to content

godsent

Members
  • Posts

    74
  • Joined

  • Last visited

Everything posted by godsent

  1. Lets say I have two tables: Table1 Id Name 1 Joe 2 Greg 3 Susan 4 Max Table2 Uid comment 2 Good customer 4 Great guy What I want to do is list all elements of Table 1, and if Table1.Id = Table2.Uid I want to select this comment. If comment does not exist give blank field. Result should be: 1 Joe 2 Greg Good customer 3 Susan 4 Max Great Guy I can't figure out how to do it, if I write: select table1.Id, table1.Name, table2.comment where table1.id=table2.Uid It gives me only users 2 and 4. Do you have any ideas?
  2. I've been reading about PHP developer interview questions. One of them was to ask person do design a most simple website using HTML code by hand writing. And it was said that if a interviewee writes something like <img src="someimage.gif"> it indicated that you can call next interviewee right now. So despite not being alt and title attributes what is wrong with using images in this way?
  3. Say I wanted to obtain words from the above code: accommodation and food. Before both of them there is '>' symbol and after both of them there is </a><sup><a class="tooltiphelp" So I am trying to get words in between code: > WORD </a><sup><a class="tooltiphelp" preg_match_all('/>(.*)<\</a><sup><a class=/i',$str, $match); But It seems that I do not understand that I am doing very well, and this regex syntax is very puzzling to me. How should the syntax look like?
  4. I would like to make to make multiple chats, where every chat entry would be inserted into mysql table, each chat entry would have a coresponding ID to which chat it belongs, SO it would be many rows in this table. In other case a simple text file would only hold messages of specific chat. My question: is it faster to search the sql table with very many entries or is it faster to read a text file (much smaller)?
  5. This is the simple example I am trying to make work: http://jsfiddle.net/KkkA3/22/ Once you click on the green box its unbind form any clicks and once you click the blue box the green box should be bind but its not. Do you see the problem?
  6. For example if the object is programmed to animate, and you click on it multiple times before it finishes the animation, the animation will repeat for as many times as you clicked. How can this be avoided? If I have a POST method instead of animation, it can be spammed and cause difficulties. I know button can be disabled after click, but what if the the clicking object is <img> ?
  7. I would like to write a code to move image1 to place of image2 (removing image2 in process). It should be easy, but It does not move enough in x and y directions. var pic1 = $('#image1).offset(); var pic2 = $('#image2').offset(); var dx = pic2.left - pic1.left; var dy = pic2.top - pic1.top; $('#image2').hide(); $('#image1').css({position: 'absolute'}).animate({ 'left': dx, 'top': dy}); Even it seems to work it does not move the entire way, image1 does not reach image2 place. I can't figure out whats the problem. <img id="image1" src="images/deck/image1.jpg" /> <img id="image2" src="images/deck/image2.jpg" />
  8. Two questions here: 1. Do you need any licence for a cards website where people play for fun for free. 2. Do you need any licence for a cards website if people can buy some kind of credits and then play while staking these credits?
  9. I did, I just would like to hear what you guys think.
  10. I bought hosting+domain several days ago from hostblast.net, since they offered very cheap hosting. Website and domain was working fine for two days, but a hour or so ago it suddenly stopped working (also ftp with the domain). I checked some websites that sells domains and my domain appears as unregistered (available to buy). Is it some kind of temporary error or this is simply a scam hosting?
  11. Then I enter my domain to page: http://whois.domaintools.com it gives my name and address. Is there any way to hide this personal information?
  12. For example if now is: 03-Jan-2011 10:33:56 The script would show: 03-Jan-2011 10:28:56
  13. To get current date and time I use: $date = date("d-M-Y h:i:s"); But how can I get date and time which was before 5 minutes.
  14. solved myself, simple as that var clicked = $(this).attr('uid');
  15. I would like to grab value of "uid" of this code: <a href="# class="hop" uid="1"><code>1</code></a> I am using this code: var clicked = $(this).parents('a[uid]:eq(0)').attr('uid'); alert(clicked) Still getting 'undefined', can't figure out whats wrong. The worsed thing that almost the same code worked before for "li" <li ID="123"><a class="hop highlight" href="#">text</a></li> $(this).parents('li[iD]:eq(0)').attr('ID'); I can't figure out the problem, if you know please help.
  16. Is it possible to make text on image underlined or italic? And if its possible to make part of text normal and another part (italic)? And the last question is my code for writing text is proper? $text = wrap(12, 0, "arial.ttf", "One day, Two days, Three days and all other days.",300); $font = "arial.ttf"; $size = "12"; $width = 300; $height = 400; $image = imagecreatetruecolor($width, $height); //blank img $bgcolor = imagecolorallocate($image, 255, 255, 255); // white $color = imagecolorallocate($image, 0, 0, 0); //black $x = 10; //begin write on x $y = 20; //begin write imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $bgcolor); imagettftext($image, $size, 0, $x, $y, $color, $font, $text); header('Content-type: image/png'); imagepng($image); imagedestroy($image); function wrap($fontSize, $angle, $fontFace, $string, $width){ $ret = ""; $arr = explode(' ', $string); foreach ( $arr as $word ){ $teststring = $ret.' '.$word; $testbox = imagettfbbox($fontSize, $angle, $fontFace, $teststring); if ( $testbox[2] > $width ){ $ret.=($ret==""?"":"\n").$word; } else { $ret.=($ret==""?"":' ').$word; } } return $ret; }
  17. <p><input type="radio" name="type_select" value="1" class="styled" /> 111</p> <p><input type="radio" name="type_select" value="2" class="styled" /> 222</p> <p><input type="radio" name="type_select" value="3" class="styled" /> 333</p> I would like to check if user have selected any value like this: alert($("input[@name='type_select']:checked").val()); // if value not selected it alerts "3", and no matter if page is refreshed or just entered if ($("input[@name='type_select']:checked").val() == "unidentified") { alert("Please select any value."); }
  18. for example I have this div <div id="currentdiv" class="pie size35"></div> How could I change class "size35" to for example "size50"?
  19. try window.opener='x'; window.close();
  20. I want that my javascript would fill the iFrame forms, and my code looks like this: <html> <head> <script language='JavaScript'> function AutoFill() { document.frames['PageTwo'].document.forms['Members'].elements['Search'].value = 'samxt'; } </script> </head> <body onload="AutoFill()"> <input type='button' value='Try again' onclick='AutoFill();'> <iframe name='PageTwo' src="out.php" width='100%' height='100'></iframe> </body> </html> and the framed file: <html> <body> <form name='Members'> <input type='text' name='Search' value='Chris'> </form> </body> </html> Why this only works on IE6? I tried IE7 and Mozilla and it not worked, maybe its possible to adapt script for jquery to fix this problem?
  21. I found this code to get current date with timezone, but the problem is that this returns my current computer date, for example if I set computer date to 2001, echo $date, gives me that today is 2001. $timezone = 2; $date = gmdate("Y/m/j H:i:s", time() + 3600*($timezone+date("I"))); Possible option that is because my computer is my host?
  22. Works fine thanks, success returns 1, fail = -1.
  23. If this is a good way to see if action was successful to continue: function changeGameState($GameId) { mysql_query("UPDATE challenges SET status=status+1 WHERE id='$GameId'"); } if (changeGameState($someId)) { //was successful } I dont know if it work or not, but i think no because changeGameState wont return any value, so I came up with another idea, but it gives me "Parse error: syntax error, unexpected T_RETURN " error in "return 0" line public function changeGameState($GameId) { mysql_query("UPDATE challenges SET status=status+1 WHERE id='$GameId'")or die(return false); return true; } how can i check if action was succesful before continuing?
  24. can PHP see difference between capital letters (B and b), will this show capital letters as illegal?
×
×
  • 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.