![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
dreamwest
-
Posts
1,223 -
Joined
-
Last visited
Never
Posts posted by dreamwest
-
-
Using JavaScript to generate a menu is an awful idea. How will crawlers navigate your site?
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..
-
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 />"; }
-
load the file into a string then preg_match the search term
-
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
-
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();'>
-
Can I give it a TCP test?? Itll be supa fun i promise
-
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 ) )
-
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
-
Is it with scriptlance? You can cancel the project anytime and get your escrow back
-
you mean html specialchars
Ω = Ω
Ψ = Ψ
-
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"; }
-
RewriteRule ^$ index.php?var1=statement&var2=statement [L,QSA]
-
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
-
It would be so much better if he bit her head off with super fangs like the clown did in "it"
-
Ive always been proud of failing my way to success....and helping others do the same
-
Why doesnt my sisters cat like me - I mean all i do is put it in a box and shake it up and down
-
change "1" to "01"
-
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
-
-
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?
-
This will strip all whitespace and normalizes your string
$text = "This is a dummy text. "; echo preg_replace('!\s+!', ' ', $text);
-
waste of time bootloading js, just gzip it a 40kb js file will reduce to 4kb or less...its like some kinda voodoo magic
-
-
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
document.write()
in Javascript Help
Posted
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..