dreamwest
-
Posts
1,223 -
Joined
-
Last visited
Never
Posts posted by dreamwest
-
-
Why did the koala fall outta the tree.......??
Cause it died!!
-----------------------
A truly wise man never plays leapfrog with a unicorn.
-
so how did you achive this, i have done before via ajax but wbu ?
Its ajax and javascript on roids
Theyre proberly using ob, flush etc.. stuff as well........and maybe even smarty caching
I'm not sure you have a clue what your talking about, but it is very amusing.
True. I have no idea HOW it works, but it works.
ob_end_flush(); ob_flush(); flush(); ob_start();
Most successful ppl know - you dont need to know everything to be successful, in fact here are some truths about being successful:
*The key to success is laziness
*Good thing im not intelligent - otherwise ill have a "good job" <-emphasis on good job HA!
*The less you do the more you earn
*Duplication is the key to success
The moral of the story:
You dont need to know everything about programming to be a successful at it -
Hey im rich and happy - what do i care
You can be pulled around all your life from one "generated crisis" after another - the world isnt perfect, i know i can live with that
-
so how did you achive this, i have done before via ajax but wbu ?
Its ajax and javascript on roids
Theyre proberly using ob, flush etc.. stuff as well........and maybe even smarty caching
-
You can build and Million+ page site with a few lines a code, include the header and footer and your done. Of course this doesnt mean all your urls will be the same, make them dynamic with 1 line of htaccess :
RewriteRule ^view=(.*) view.php?id=$1 [L,QSA]
-
OK ive improved it:
session_start(); error_reporting( 0 ); function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } $_SESSION = array(); if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } session_destroy(); redirect('/');
-
Thats not a particularly good logout script though. The session_destroy function doesn't actually unset any of the global variables, it only destroys information about the session itself. If session_start is called again the values will still be set, this is undesirable behavior.
But thats all logout.php will contain:
session_start(); session_destroy();
...and maybe a redirect to the main page.
I tested it - I destroyed the session and went to another page on the same site and the session was gone..... Magic
-
Now I just need to get the Cronjob setup, I need to figure out how to make it update all the images that have been created..
Continually update an image that hasnt changed?? I thought i was bored :-\
-
Logout:
session_start(); session_destroy();
Ive seen some ppl make logout script 6 KB in size, what are they thinking - its so easy
Login:
session_start(); $_SESSION['userid'] = 'name here';
-
I can't seem to see a great deal of difference in speed. You do loose the functionality of the back button though... And of course you loose all the extra features that comes with Google. Is there an image search?
Its not the site thats great, its the page loading speed thats the beauty. Other than that the site is pretty ordinary.
If this is a Metasearcher they need to be given an award, most metasearchers take 2-6 seconds for a request
-
Your productivity will increase dramatically with ajax http request, im able to process 1000's of database requests within a few minuets through my admin panel without 1 page reload.
-
preg stuff uses more resources and should be used sparingly, explode and str_replace are better alternatives for looping data
Im assuming the dictionary has over 500 words in it so:
for($i=0;$i<count($dictionary);$i++){ $parts = preg_replace("/\b$dictionary[$i]\b/", $htmldictionary[$i], $parts); $parts = preg_replace("/\b" . strtoupper($dictionary[$i]) . "\b/", $htmldictionary_u[$i], $parts); $parts = preg_replace("/\b" . ucfirst($dictionary[$i]) . "\b/", $htmldictionary_u1[$i], $parts); $parts = preg_replace("/\b" . ucwords($dictionary[$i]) . "\b/", $htmldictionary_ucwords[$i], $parts); }
Is executing for each word. Change it all to str_replace
-
If title is a variable and your calling it before you defined it, of course it wont display anything
<?php echo "<title>{$title_name}</title>"; $title_name = "Title here"; ?>
You will need functions.php above the title tag
<?php include('functions.php'); //which has the $title_name variable in it echo "<title>{$title_name}</title>"; ?>
-
You can set the fields as UNIQUE, but that will crash your script if you try to add a duplicate, heres an easy way:
if ( $_POST ['Submit']){ $username = mysql_real_escape_string($_POST ['usernm']); $userpassword = mysql_real_escape_string($_POST ['userpw']); $result = mysql_query("SELECT usernm FROM users WHERE usernm='{$username}' and userpw='{$userpassword}' "); if($result){ $num = mysql_num_rows( $result ); if ($num == 0) { $querypost = mysql_query ("INSERT INTO users (usernm, userpw) VALUES ('$username','$userpassword')"); } } }
-
874ms on average from 10 pages. Comparable to 892ms for Google...
Not only that but theres no page reloading which makes the user experience faster than google
Page reloading is on its way out - FINALLY!
-
Try turning pages and see how fast it loads
-
Have you ever seen anything so beautiful:
http://fireball.de/ajax.asp?Auswahl=deutschem+Web&q=funny&Button=Submit+Query#3
I almost cried its so fast :'(
-
I found this, it improves the image by up to 200%
$im = new imagick( "test.png" ); $im->contrastImage( 1 ); $im->adaptiveBlurImage( 1, 1 ); //output header( "Content-Type: image/png" ); echo $im;
But im still curious if there is something else i can add to this to get an even better image
-
I want to increase photo quality and give it a touch of HD glamour. Ill need to put it thorugh some filters- Sharpen, resolution etc..
-
Im trying to improve the quality of some images, they are all jpg.
What is the best Imagemagik or GD function to do this??
-
Where is curl located? IN the include script??
You just need the url for curl to post to, then set the curl_setopt you want. In your form you only need what you are posting nothing more. Your form action should point to where curl is.
curl is quite easy once you play with it a bit, then youll want to learn multi handle function curl_multi_add_handle, you can literally open 1000 pages within seconds and post to them all
-
Ive revised this, this will give you title, player and thumb
$src = file_get_contents("http://gdata.youtube.com/feeds/videos?vq=Gitano%20corazon&start-index=1&max-results=10"); preg_match_all('~<media:player url\s?=\s?[\'"](.*?)</media:title>~is', $src, $match); foreach ($match[1] as $stuff) { $tmb = explode('watch?v=',$stuff); $tmb = explode('&feature',$tmb[1]); $tmb = $tmb[0]; $title = explode("<media:title type='plain'>",$stuff); $title = $title[1]; $play = explode("'/><media:thumbnail",$stuff); $play = $play[0]; echo "<img src='http://i.ytimg.com/vi/{$tmb}/2.jpg' height='90' width='120'><br>Title: {$title}<br>Player: {$play}<br>"; }
-
Personally i would never store images in a database - store them in your filesystem, then you can compress and cache them. Then use ob_flush(); etc to boost your loading times
-
Most likely ajax http request, its not really including another page just requesting it without reloading
Have you ever seen anything so beautiful?!
in Miscellaneous
Posted
You know i COULD do a simple search on these functions to find out the specifics....but im too lazy
Im !assuming! it flushes the contents of the browser buffer to be displayed...i think one of them does anyway