Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
On the included one, there is an extra character before <div id ="header"><img id="logo" src="img/logo.png"> [attachment deleted by admin]
-
http://www.w3schools.com/browsers/browsers_stats.asp I think you have that backwards my friend.
-
Using their API: http://wiki.developers.facebook.com/index.php/Users.getInfo
-
You need to use in_array: if(in_array($browser, $bot)) { exit(); } else { //... instead of if ($browser == $bot[]) { exit } else{ //...
-
Okay, I'm confused. What is the correct path to that file? Is it: /opt/lampp/htdocs/WorkDamnit/Classes/clsMetaData.php /opt/lampp/htdocs/WorkDamnit/classes/clsMetaData.php /opt/lampp/htdocs/classes/clsMetaData.php /opt/lampp/htdocs/Classes/clsMetaData.php ? Notice the difference in capitilization. Because if the following works: then, include('/opt/lampp/htdocs/WorkDamnit/Classes/clsMetaData.php') in theory should work unless your current ini include path is pointing to somewhere it shouldnt.
-
Yeah that was a pretty big deal, I completely forgot about it though. I still personally use Vista 64bit, and haven't had any problems in the year or so I've had it installed. I'm a fan of Aero & the glassy look, as long as you have the RAM to back it up. As for startup times compared to XP. Man, my boot times in Vista are freakin fast - faster than XP ever was. A bad first impression can kill anything, Vista is a great example of that.
-
MS just keeps putting itself down the hole in its marketing. I agree with nrg, they really do need to reevaluate their whole marketing department. If that bing sound sticks around, I'm going to shoot whoever came up with it.
-
[SOLVED] PHP + Heredoc appear to not process all divs
Philip replied to Styles2304's topic in PHP Coding Help
You're going to have to show more, including the loop as Andy-H asked about. Everything in the HEREDOC looks correct to me, so it's probably a problem with your loop. -
Try using a full path to see if you can find it. Such as: include '/opt/lampp/htdocs/WorkDamnit/classes/clsMetaData.php'; Also, in a windows PHP envi, you can still use / instead of \. It should automatically convert them over (depending on how you have it setup if I remember correctly)
-
You'll have to use JS to pass the height to PHP. PHP can't actively read from its own DOM since it is server side.
-
Is there a simple way to convert decimal into money?
Philip replied to johnsmith153's topic in PHP Coding Help
sprintf() or for printing: printf() See example #8 on sprintf -
Use ORDER BY in your MySQL query.
-
$query = "SELECT * FROM `table`"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo $row['col'], '<br>'; } If you wanted to use a foreach statement, it would seem rather pointless because it would do something like: $query = "SELECT * FROM `table`"; $result = mysql_query($query); $array = array(); // gather each row into the array while($row = mysql_fetch_assoc($result)) { $array[] = $row['col']; } foreach($array as $key=>$value) { echo $value,'<br>'; }
-
cfunction? Do you mean function? P.S. - next time use the code tags, not quote
-
You're out of scope to reach $epm. You need to pass it via a construct. My suggestion: If you're using PHP5, you can use type hinting. However, based on your current setup it looks like you either aren't using PHP5's OOP to its fullest, or you're using PHP4. Type hinting based on your code: <?php // PHP link: // http://www.php.net/oop5.typehinting // USER CLASS class user { function __construct(){ $this->id = $_SESSION['id']; if($this->id <= 0){ $this->login(); } else { $query = mysql_query("SELECT * FROM bexusers WHERE ID =".$this->id) or die("Error: Could not collect data"); $user = mysql_fetch_assoc($query); $this->email = $user['email']; $this->first_name = $user['first_name']; $this->last_name = $user['last_name']; $this->address = trim($user['first_name']." ".$user['last_name']." <".$user['email'].">"); } } function login(){ $_SESSION['ref'] = $_SERVER['PHP_SELF']; header('location: login.php'); die("Please Sign In"); } function return_info(){ return array("id"=>$this->id, "first_name"=>$this->first_name, "last_name"=>$this->last_name, "email"=>$this->email); } } // AUTH CLASS class auth{ function __construct(user $user_class){ if($user_class->user->id <= 0){ die('Error: no user id found'); //will send them to sign in screen later... } } function check_project($id){ $sql = sprintf("SELECT p.* FROM projects p LEFT JOIN usergroup");//incomplete query! } } // From include.php: if(true){ // for testing $epm->user = new user; $epm->auth = new auth($epm->user); } ?>
-
I'm down for free food.
-
Same - education. I have a friend whos into the whole blogging/affiliate market. Not my cup of tea, but he's made some money off of it.
-
Take a look at eye tracking and heatmaps - they will give you a lot of honest data about how people look at your site. 1 - If you're not going for either of the solutions above, yes for sure. I prefer using a scale with a 'rate this feature' - but also have room for them to list specific ideas/comments on each question. 2 - Depends on how many pages you're testing them over. One or two, be specific; more, be more general but ask some specifics. 3 - Thank them for their time and ask them to leave. haha
-
Based off of one of my larger sites, which uses a 200mbps line, I'm going to say a 100mbps line is way overkill for you. BUT, that also depends on what your clients' sites are, they current usage, how they will grow, etc. It's hard to say without more data about your clients, but especially if they are smaller sites a 100mb line is overkillll.
-
From what it sounds like, you need to use a database not flat files. If you're worried about high traffic loads, 300 users really isn't that much - but optimize your queries and ultimately use a cache to store frequently used data. I use memcache just because its more expandable for larger sites, but APC should work find for you.
-
Well, it's because you're using single quotes, so PHP will take the value $custom_length as a string, and not execute it like a variable. Either use double quotes ( " ) or you need to concatenate the value. Or change the way your function takes arguments, to just have like: function get_posts($number = 3) { // function here } // calling the function: get_posts($custom_length); // using the default value of 3: get_posts(); // or set your own: get_posts(9);
-
Well, you're not running $dbarray through a loop to get each result. That is of course, unless you wanted just one result. above the foreach, put: echo count($dbarray);
-
Are there any other scripts that handle your sessions?