Everything posted by php_penguin
-
Have You Ever?
Yes, not caused by me though. Have you ever hit an animal on the road (I hit a pheasant last Tuesday)?
-
Noob Mysql Questions...
install a WAMP system - there are a bunch of programs which are aimed at installing Apache, MySQL, and PHP on your system with the minimum of fuss. Unfortunately I haven't used Windows for about 2 years now, so my knowledge of specific programs is zilch atm. Do a search for "WAMP" or wait for someone else to reply.
-
What Are You Studying/working As?
Eggman: the official definitions from t'govrenment are 1 - 20 is "small" 20 - 100 is "medium" 100+ is "large"
-
Refresh Page Only On Update
http://www.richardlyon.co.uk/ajaxPush/ a quick example of the continuous refresh I mentioned - you should get an average of about 0.5s
-
Refresh Page Only On Update
spikemeister: I'm developing a chat script too, and here are a couple of thoughts to try out: - use a continuous refresh system, where a fresh request for data is sent as soon as the old one is recieved. Other than a (complicated) Comet (server push) system, this is the best way to reduce lag. - use sessions to store the users last received message id. some example flow, using a database for storing the messages // Data already existing are "user_id", mysql connections, and session "chat id" session_start(); if( !isset( $_SESSION['last_post'] ) ) { $_SESSION['last_post'] = 0; } $query = mysql_query( "SELECT * FROM `chat` WHERE `to` = '".$user['id']."' AND `chat_id` = '".$chat_id."' and `id` > ".$_SESSION['last_post']." ORDER BY `id` ASC" ); while( $row = mysql_fetch_assoc( $query ) ) { $_SESSION['last_post'] = $row['id']; // print formatted message }
-
Z-index In Firefox
Hi, Firefox interprets any z-index of less than 1 to be the same as "below everything including the body" you need to use a z-index of 1 or more. To be honest, if you are experiencing troubles with z-index and the backgrounds in the foreground, there is probably some more fundamental problems in your code.
-
New Sata Hd Causes Post 75
usually I just plug it in and it works - the only exception was with 2 SATA 160's and an IDEA 20 which caused the windows install not to work, so I just unplugged the IDE
-
<body Onload> X2
instead of putting the executable JS code in the onload statement, make the onload point to a js function. <script type="text/javascript"> function onload() { MM_preloadImages('images/menu/homehomeover.jpg','images/menu/ homeservicesover.jpg','images/menu/homeportfolioover.jpg','images/menu/ homepricesover.jpg','images/menu/homenewsover.jpg','images/menu/ homeimageryover.jpg','images/menu/homecontactover.jpg'); goforit(); } </script>
-
New Sata Hd Causes Post 75
if the drive worked before you formatted it and added it to the GPT record, it's probably because the system can't decide which one is the "master" drive (ie the one to boot), because they both have boot flags, or both don't have boot flags. Try booting up an Ubuntu live disk and seeing what the flags and partition details of each drive are.
-
When Will Rob Be Number One Poster?
1st May - he'll probably be posting more now that he can see the finishing line in sight
-
Php Book Recommendations
I am quite happy to bet that by the time I graduate (June 2011), most hosts will only just be starting to cease support for PHP5 (although PHP5 will still be usable). I learned PHP from a sAms "learn PHP in 24 hours" book, but that was from complete beginner to "slightly less noobish" Once you get past the beginner books, they tend to diverge into books which focus on - "application development" - mostly methods (waterfall, agile, etc) and directory structures (mvc), and OOP (classes) - "database development" - how to design your database, and how to CRUD it - "ajax development" - how to make a site with AJAX capabilities, often assumes you already read the other two types of book If you pick up one of each type, or at least of the first two you should have a pretty good grounding. Recommendations: - http://www.kofler.cc/mysql/mysqlbook.html - http://www.packtpub.com/codeigniter-php-ap...lopment-mvc/107 (IF you want to use CodeIgniter, it's great) - http://www.amazon.co.uk/Creating-Interacti...993&sr=1-11 a good mix of all 3 topics
-
With This Post...
I thought the admin could change peoples post counts at will? Or maybe I am thinking of a different forum software...
-
Web Rage?
I used to have "no internet" rage but then I switched to a more reliable ISP - kicking a hole in my wall (only plasterboard) really made me realise how rubbish Gaia ISP was.
-
What Are You Studying/working As?
Same as RobH nearly - currently working as a freelance web developer, and I am going to the University of Liverpool in September to study BSc Computer Science.
-
What Is Your....
Favourite Food? Malt loaf (too much fibre though) Favourite Drink? Strawberry Frijj milkshake Favourite Colour(s)? Grey. Favourite Letter? Thats weird Favourite Number? 7 FavouriteCandy? Minstrels Favourite Animal? Penguin Favourite Messenger? Pidgin (MSN) Favourite Store? Amazon Best Memory? Holiday in Abersoch with my gf Overused Phrase? oic First Thought Waking Up? Wow it's dark already Weakness? Talking to people. also: big LOLs for ElanMan
-
This Is So Cool
http://www.alistapart.com/articles/accessi...tavisualization
-
Home Sweet Home
welcome back Rob! Shame on you for not posting as soon as possible... come to that why didn't you post from France? Lol, nice to see you back.
-
Tattoo For A Wdf Member
The Woman class. <?php class Woman extends Human (probably) { var $age; var $sexism; var $numberOfEpisodesOfSexAndTheCity; var $numberOfDivorces; var $chanceOfBeingWrong = 1; function Woman( $age, $numberOfEpisodesOfSexAndTheCity, $numberOfDivorces ) { $this->sexism = $age*$numberOfEpisodesOfSexAndTheCity; $this->bitchinessTowardsMen = $age*$numberOfDivorces; $this->bitchinessTowardsWomen = $age*$numberOfDivorcesCausedByThatWoman; } } ?>
-
Login To A Webpage
a method I use is to create two random hashes like so: $hash1 = sha1(rand()); $hash2 = sha1(rand()); $query = mysql_query( "UPDATE `users` SET `hash1` = '$hash1', `hash2` = '$hash2' WHERE `username` = '$username' AND `password` = '$password'" ); // where username and password are the results of the form submittal. setcookie( "user_".$hash1, $hash2, time()+86400 ); // one day The use of two random hashes makes it nearly impossible to "guess" the correct cookie combination to enter an account - the easiest way to secure it further would be to record the users IP address and re-authorise them if it changes. To see if a user has logged in, do this code : foreach( $_COOKIE as $key=>$val ) { if( strlen( $key ) == 45 && strlen( $val ) == 40 && !isset($user) ) { // sha1 hashes are 40 chars long, plus "user_" $query = mysql_query( "SELECT * FROM `users` WHERE `hash1` = '".substr($key,5)."' AND `hash2` = '$val'" ); $user = mysql_fetch_assoc( $query ); } } and you're done
-
Anybody Else With Children ?
I've met one or two - does that count? You could always just work in the attic, where the little'uns can't get to?
-
Tattoo For A Wdf Member
ErisDS: I hope he has a second <head> section... somewhere...
-
Tattoo For A Wdf Member
shame there isn't a <neck> tag... also, does he have an </body><foot> section?
-
The Grand National! Are You Betting? :)
yay for me! Only put £4 on Comply or Die, but I made a £36 profit on the day... back to work then.
-
The Grand National! Are You Betting? :)
it's my first year doing this, so I split a tenner over three horses Slim pickings Comply or Die Contraband lets hope one of them comes through, although the "buzz" from the reporters seems to point at Hedgehunter and Lami
-
Javascript Inside Php
it is because you are using the single quotes twice for the same attribute. this will work $marks.="<img src='".$base."images/buzz.png' onmouseover='this.src=\"".$base."images/buzz_grey.png''' onmouseout='this.src=\"".$base."images/buzz.png\''' />";