Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Everything posted by dreamwest

  1. Im just obsessed with instant page loading, ive had some good success with preprocessors and compression. The page loading time has been reduced to (Time: 0.076079) front end, but thats with menus, if i can store the template in the servers memory im assuming that would so the trick. Anyways i havent given up..
  2. What i really wanted to do was store part of the page such as the menu in memory. Im just not sure how to go about it without using a 3rd party app like eaccelerator - theres gotta be some way to do it..
  3. Another example: $str = file_get_contents("information.txt"); preg_match_all('~alt\s?=\s?[\'"](.*?)[\'"]~is', $str, $a); foreach ($a[1] as $c) { echo "{$c} <br />"; }
  4. load the file into a string then preg_match the search term
  5. I found that if you dont use admin@site.com they get through use da@site.com Instead of admin@site.com Even facebook dont allow emails with "admin" in them
  6. I wanted to include a static menu, but istead have it cached by an external js file. Is this a good idea, are there any security flaws in doing this?? js file function show_menu(){ document.write("menu menu menu menu"); return; } and the menu.html <script type="text/javascript" src="menu.js"></script> <body onload='show_menu();'>
  7. Can I give it a TCP test?? Itll be supa fun i promise
  8. Actually i thought that worked but the problem is $title in the new array get the print_r($title) SimpleXMLElement Object ( [0] => Rules of Engagement - Play Ball Extended Preview - Season 5 - Episode 12 )} print_r($arr2); Array ( [0] => Array ( [vid] => SimpleXMLElement Object ( [0] => cb-uA4QHmpDxYdpgW1jPwiYsUwjBViwlinS ) [title] => SimpleXMLElement Object ( [0] => Rules of Engagement - Play Ball Extended Preview - Season 5 - Episode 12 ) [site_id] => 10 [time] => 456 ) [1] => Array ( [vid] => SimpleXMLElement Object ( [0] => cb-pOEUN4deIJ2cc_22ZjFCaCIcgimN6D2A ) [title] => SimpleXMLElement Object ( [0] => David Letterman - Matt Damon: Tongue-Tied - Season 18 - Episode 3415 ) [site_id] => 10 [time] => 456 ) )
  9. Im trying to parse this xml but i can get it to output a simple string, can someone see what im doing wrong?? $str = "<channel><item> <id>cb-uA4QHmpDxYdpgW1jPwiYsUwjBViwlinS</id> <title>Rules of Engagement - Play Ball Extended Preview - Season 5 - Episode 12</title> </item> </channel>"; $n_data = new SimpleXmlElement($str, LIBXML_NOCDATA); foreach ($n_data->channel->item as $d) { $vid = $d->id; $title = $d->title; print_r($d->title); //testing die(); //testing $arr2[] = array('vid' => $vid, 'title' => $title, 'site_id' => 10 ,'time' => 456); } The print_r() returns SimpleXMLElement Object ( [0] => Rules of Engagement - Play Ball Extended Preview - Season 5 - Episode 12 ) If i simply echo $d->title it returns a string, but i need to reapply $d->title to another array as shown above
  10. Is it with scriptlance? You can cancel the project anytime and get your escrow back
  11. you mean html specialchars Ω = Ω Ψ = Ψ
  12. Ive been trying to get this email attachment to work but I think one of the headers is wrong. It wont attach the file $address = "mail@site.com"; $subject = "Test HTML Message"; $hash = md5(rand().time()); $headers .= "From: yourname <you@youremail.com>\r\nReply-To: noreply@youremail.com"; $headers .= "\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"bound-{$hash}\" "; $file = "http://www.site.com/images/funny.jpg"; $attachment = chunk_split(base64_encode(file_get_contents($file))); $ext = pathinfo($file, PATHINFO_EXTENSION); $file_base = pathinfo($file, PATHINFO_BASENAME); $body = " --bound-{$hash} Content-Type: text/html Content-Transfer-Encoding: 7bit <h2>Hello from Wizecho!</h2> <p>This is the actual email you will receive with <b>HTML</b> <i>formatting.</i></p> --bound-{$hash} Content-Type: image/jpeg name=\"{$file_base}\" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment {$attachment} --bound-{$hash}-- "; if(mail($address,$subject,$body,$headers)){ echo "Email Sent"; }else{ echo "Mail not sent"; }
  13. RewriteRule ^$ index.php?var1=statement&var2=statement [L,QSA]
  14. A preprocessor like wiki uses, partition the database and use BOOLEAN mode for sting searches http://www.wizecho.com/nav=php&s=php_mysql_boolean , delay key write in mysql, pack keys if not primarily writing to it , use a compression module for smaller page size aka 40kb will be 5kb And the all mighty holy grail - Create an inverted index with a stem class
  15. It would be so much better if he bit her head off with super fangs like the clown did in "it"
  16. dreamwest

    Fail

    Ive always been proud of failing my way to success....and helping others do the same
  17. dreamwest

    Cats

    Why doesnt my sisters cat like me - I mean all i do is put it in a box and shake it up and down
  18. change "1" to "01"
  19. SELECT * FROM `table` WHERE MATCH `title` AGAINST('{$searchterms}' IN BOOLEAN MODE) ORDER BY id asc You should ALWAYS look to MATCH AGAINST for your queries to start with, if you cant do it with that use other query types If you have an immense database like me, create an inverted index that way your only searching the word and not the whole document, and its SUPER effective
  20. http://www.pixlr.com/editor/
  21. I have a simple select but it wont return the values i need, maybe someone can tell me why its doing this: Table 1: v_id v_word 70 south 69 park 68 brub 67 brrub 66 brrrrub! Table2: l_id l_word_id l_vid_id 70 70,69,68,67,66 834785 SELECT * FROM `vid_loc` AS l, vid_words AS v WHERE MATCH v.v_word AGAINST ('south park' IN BOOLEAN MODE) AND v.v_id IN (l_word_id) GROUP BY v.v_id This returns: l_id l_word_id l_vid_id v_id v_word 70 70,69,68,67,66 834785 70 south but this selects the two rows i need: SELECT * FROM `vid_loc` AS l, vid_words AS v WHERE MATCH v.v_word AGAINST ('south park' IN BOOLEAN MODE) AND v.v_id IN (70,69,68,67,66) GROUP BY v.v_id This returns: l_id l_word_id l_vid_id v_id v_word 70 70,69,68,67,66 834785 69 park 70 70,69,68,67,66 834785 70 south So the question is: IN (l_word_id) and IN (70,69,68,67,66) both have the same value but why do they return different results?
  22. This will strip all whitespace and normalizes your string $text = "This is a dummy text. "; echo preg_replace('!\s+!', ' ', $text);
  23. waste of time bootloading js, just gzip it a 40kb js file will reduce to 4kb or less...its like some kinda voodoo magic
  24. http://www.wizecho.com/nav=scripts&s=ajax_image
  25. Why cant a guy fold in half and "enjoy" himself more often I have these same questions.. But teeth are tissue not bone, anyhow enamel is too brittle to make a solid tooth
×
×
  • 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.