Jump to content

razorsese

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by razorsese

  1. Have you tried replacing the statement if($i == 5) with if($i % 5 ==0 ) so at every 5 item its creating a new tr?
  2. How I can replace the white line whit something else Example: simple sentence simple sentence simple sentence simple sentence simple sentence simple sentence to something like this $replaced simple sentence simple sentence simple sentence $replaced $replaced simple sentence simple sentence simple sentence $replaced
  3. Why when i'm doing something like in index.php: require("x/y.php") Y is found but when I do something like: index.php require("z.php") z.php require("x/y.php") Isn't working?
  4. Yep. return $this->{ $this->y }(); Actually return the function with name Y.
  5. I have the following code: My question is how i can return both the y and the z in magic function.( works with y alone) class X{ private y; private z; public function __construct($y,$z) { $this->y = $y; $this->z = $z; } public function magic() { return $this->{ $this->y }(); //need to return both Y & Z } }
  6. How I do ajax request in MVC pattern? For example if I send ajax request to index--controller how I can returned it back to ajax because all my data is echoed in index--view.
  7. So i got the following url format localhost:8080/test now i have 1 link named LI if i click on it it becomes: http://localhost:8080/TST/il and in it i have a list of links if i click on one of them it becomes: http://localhost:8080/TST/item/view/19 but now if I want to go back to that list if i click on LI it dosen't go back to http://localhost:8080/TST/il but instead it go to http://localhost:8080/TST/item/view/il the html code for the link is the following <a href="il">LI</a> and my .htaccess is the following : RewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?controller=$1&action=$2&id=$3 [NC]
  8. I dunno if I should use fullscreen for js youtube player.I've heard that are some security problems with it
  9. Hello to everyone!! I just messed around with javascript and I build this : Just search for a video and click it and then it will go into playlist.Playlist stay saved even if you quit browser!! http://crispo.tk Any critics will be appreciate!! P.S : I know it dosen't work with IE( sucks) and is heavly depedent on javascript!
  10. I can't because i use 960 GS
  11. How I can achieve a full screen width div? Currently i'm using this code but when i scroll whit mouse wheel button on the right of the screen the div is not hidden; body{ overflow-x:hidden; } div { margin: 0px -2000px; padding: 0px 2000px; }
  12. I have the following code which works perfectly "<a href=".$t[$key]->title." />"; but if i change it to "<a href="$t[$key]->title" />"; it's appearing Catchable fatal error: Object of class product could not be converted to string in My question is can someone explain why that error pop-up?!
  13. First thanks for answer And second isn't there any work around to put column names from a variable?!
  14. Yes because when i remove the pdo from mysql statement it's working perfectly whit that value And my error report are on
  15. Sorry for my late reply!! The $word value is a value entered by user I always use "honey" for test
  16. I'm having a problem whit the pdo - sql statement: It dosen't return anything but when i try $sql = " SELECT en FROM word WHERE MATCH (sp) AGAINST (:word IN BOOLEAN MODE ) "; without the pdo it's working perfectly $sql = " SELECT en FROM word WHERE MATCH (:sp) AGAINST (:word IN BOOLEAN MODE ) "; $st = $con->prepare($sql); $st->bindValue(":word",$word,PDO::PARAM_STR); $st->bindValue(':sp','sp',PDO::PARAM_STR); $st->execute();
  17. Yes i have error_reporting(-1) And i tried whit the :word removed and still nothing
  18. I'm having trouble of getting the code right When i try to dump the $x value it's appearing null; class Dictionary{ var $id=null; var $en=null; var $sp=null; var $type=null; public function __construct($data=array()) { if( isset($data['id']) ) $this->id= (int)$data['id']; if( isset($data['en']) ) $this->en= $data['en']; if( isset($data['sp']) ) $this->sp= $data['sp']; if( isset($data['type']) ) $this->type= $data['type']; } public function store ( $params ) { // Store all the parameters $this->__construct( $params ); } public function WordGet($word)//add the english and spanish word { $con = new PDO(DBN,DB_USER,DB_PASS); $sql = "SELECT *FROM word WHERE MATCH(en) AGAINST ('ctx')"; $st = $con->prepare($sql); $st->bindValue(':word',$word,PDO::PARAM_STR); $st->execute(); $r = $st->fetch(); $con = null; return new Dictionary($r); } $test = new Dictionary; $x = $test->WordGet('ctx'); var_dump($x);
  19. I need to return a specific key from the object converted to array but it seems that it dosent work $toarray = (array)$tmp; $name = array_keys($toarray,'name'); print_r($toarray); print:Array ( [id] => 9 [name] => dfd [text] => fdsf [rating] => 0 [totalv] => 0 ) and when i try to return the key print_r($name); Array ( [0] => rating [1] => totalv ) But I only need the key whit the 'name' value
  20. Actually I manage to refresh the content through a iframe and a refresh meta tag!!
  21. I thought it was a dumb idea Anyway thanks
  22. I need to execute something after a specific sleep time Like a random function which display a random image into html every 2 min; But i don't know how to do the 'every 2 min' part
  23. I got 30 files to convert to png each in a dir containing 5 files I get the maximum execution time when i run the following code: $dir = glob("images/*/*.png"); foreach($dir as $file) { $filename = $file; $files = getimagesize($filename); $img = imagecreatefrompng($filename); imagepng($img,$filename); }
×
×
  • 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.