Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. try if (($uploaded_type != "image/jpg") or ($uploaded_type != "image/jpeg"))
  2. xor means (either or).. not both. just use or.
  3. Zane

    Google Wave

    send me an invite!
  4. your missing a semicolon after mysql_query
  5. Zane

    Center DIV tag?

    if you make something's position absolute then margins and padding are out of the picture and you have to rely on the directional properties to position your div. So if your div is absolutely positioned you have to set it's left and top properties to 50%. .example { position:absolute; left:50%; top:50%; } If you chose the other route, static positioning (default).. you could simply set your margin to "0 auto"; .example { margin: 0 auto; }
  6. while($x if(($x % 5) == 0) echo "The Fifth Time!"; else echo $x; }
  7. I'll start from here $result = mysql_query($qry,$connection); This is your data.. you may not be able to echo $result with it without and error, but it is your data. It's more commonly referred to as a resource. As in MySQL resource. You see to have this part down... pretty straight forward $result2 = mysql_num_rows($result); if($result2 == 0) { die('Username does not exist.'); }else{ /////Display the data in an image gallery. } The displaying your data part consists of taking the RESOURCE and putting it into something that you CAN echo. Like an Array... of Strings (text,letters,numbers) Thankfully PHP has just the function to do that which is called mysql_fetch_array. All you have to feed it is a mysql resource an it spits out an array. mysql_fetch_array($result); But we still can't echo that because... well, what would we echo... unless we just prepended it It needs to be stored to a variable. Why not call it $row, since that is what is going to be in this variable.. the top row's data. Until you call mysql_fetch_array again, then it will call the second row. and so on and so on... $result = mysql_query($qry,$connection); $row = mysql_fetch_array($result); echo $row['UserName']; // Prints the first user $row = mysql_fetch_array($result); echo $row['UserName']; // Prints the second user That kind of coding could get to be quite the eyesore afterwhile though and is really illogical.. considering there's loops to take advantage of. $result = mysql_query($qry,$connection); while($row = mysql_fetch_array($result)) { echo $row['UserName']; } That would do the exact same thing. Isn't that neater? Everything beyond that is pretty much basic HTML and CSS.
  8. Zane

    2500th post

    +1 spampostcount for me
  9. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
  10. Ah, I forgot to set the default PageBackground $userArray = array(); $defaultArray = array(); $combinedArray = array(); $defaultArray['PageBackgroundImage'] = 'default-image.jpg'; echo "Defaults"; [...] The Output: Works like a charm for me
  11. How does this not do exactly that? $userArray = array(); $defaultArray = array(); $combinedArray = array(); $defaultArray['PageBackgroundImage'] = ''; $defaultArray['ContentBackgroundImage'] = 'default-content-image.jpg'; $userArray['PageBackgroundImage'] = ''; $userArray['ContentBackgroundImage'] = 'users-content-image.jpg'; $userArray['PageBackgroundImageUsed'] = 'yes'; $userArray['ContentBackgroundImageUsed'] = 'no'; echo "Defaults"; echo "", print_r($defaultArray), ""; echo "User-Defined"; echo "", print_r($userArray), ""; foreach($userArray as $k=>$v) { if(empty($userArray[$k]) || is_null($userArray[$k])) $combinedArray[$k] = $defaultArray[$k]; else $combinedArray[$k] = $userArray[$k]; } echo "Combined"; echo "", print_r($combinedArray), ""; ?> The Output: EDIT: whooa... I hardly looked at that
  12. yes.. see below code. $userArray = array(); $defaultArray = array(); $combinedArray = array(); foreach($userArray as $k=>$v) if(empty($userArray[$k]) || is_null($userArray[$k])) $userArray[$k] = $defaultArray[$k]; nevermind above.. misunderstood. $userArray = array(); $defaultArray = array(); $combinedArray = array(); foreach($userArray as $k=>$v) { if(empty($userArray[$k]) || is_null($userArray[$k])) $combinedArray[$k] = $defaultArray[$k]; else $combinedArray[$k] = $userArray[$k]; }
  13. how are you outputting it now. in other words. where's your code.
  14. don't piss in the wind. 3 guys walk into a bar. A mexican, a jew and a nigger. The bartender looks up and says.. "Get the hell out of my bar." Two muffins are sittin in an oven. One says to the other "Whoa, it's hot in here" the other muffin then says "Holy shit, a talking muffin" Why did the chicken cross the road? To get to the other side Why did George Bush cross the road? To get to the chicken.
  15. Good guess.. Well maybe a little older, I'm sure I missed a year or so of the Geocities excitement (I'm 23). I was 12 in '98 and I believe I was maybe 10 or 11 when my dad set me up with my first hotmail account. The rest is history. I couldn't tell you how I found out about Geocities but I remember "hotbot"ing for how to create websites for awhile. At this time I had no clue what HTML was...even when I found Geocities. Everything was pretty much forms, nothing nearly as fancy as the myspace themes that are setup today. Yeah, times have changed. It wasn't long until I ran across another version of Geocities called Homestead. That made use of a "Preview" technology. Something that could be compared to clicking Design view in Dreamweaver after you've been in Code View. There were still plenty of forms to fill out though. But it was FREE.. just like Geocities. and Angelfire and Tripod (Lycos) When it's all said and done though, if I had never found those websites, I wouldn't know what I know today. But it's hard to go back to using things like that once you get spoiled with a domain name and find out that it's really not that expensive (the space too). Especially when you finally learn how to maintain it and what it is that you're maintaining. RIP GeoCities
  16. I was thinking of that exact thread when that was mentioned.. was too lazy to do the dirty work though. Seeing as how threads are marked solved by the fact that their title begins with [sOLVED]. It seems to be potentially a PITA if you ask me..even though you could do the preg_match for a bbc open solved tag type thing, but it still doesn't look worth it. The active users mod seems to do the job just fine. If you're too lazy to read the entire thread and find out who the "star players" actually are then why should you even know they exist in the first place?
  17. Zane

    Religion

    Appropriate song for this thread.
  18. I either don't know shit about calculus or that sentence doesn't make any sense whatsoever. (Most likely I don't know shit, because I don't)
  19. Penguinator http://penguinator.org/ FREE cPanel http://cpanel.net Not FREE
  20. you have your preg_match wrong.. the ^ (carrot) should be inside the brackets. if (preg_match("/[^-_a-zA-Z0-9]+/", $_POST['test']))
  21. Zane

    Religion

    Yeah, I was wondering when this topic would come about... I can't remember if it's been throw or not, if so, I don't recall. I see this one all the time. Solid Proof, the good book, evolution, etc, etc. I don't think there is any solid proof. I believe that religion is sooo abstract that it can't be explained. Religion is what you believe in, not someone else. That's why I could never agree with going to church all the time. I haven't done any statistics on the matter, but it seems to me that the ones who don't project their beliefs onto others are the true believers. Everyone is raised differently and everyone goes through so many completely different tragedies in life that all I feel church really is... is a place for them to weep about it. To ask God why he did this, to find answers, to find meaning in one's life, to find the answer to that one question "Why am I not dead right now?" On the other hand, there are also a lot of people who go to church only to feel better about themselves. As if they did something good for that week. That 'good' thing being, listening to a preacher holler at everyone. Then, as they leave they're confronted with a stranger looking for a ride home..a hitchhiker. That "good" thing to do would be to give them a ride home, give them $5 if they needed it, give them a brand new pair of socks to wear, etc, etc, deodorant? The 'smart' thing to do would be to say..I'm heading the opposite direction.. or just not say anything (depending on what city you're from) What I'm getting at is.. if you're gonna go to church, give away your money to it, waste your time believing that good is being instilled within you by the preachers' repetitive words and then talk to your peers about how much that preacher changed your life. It needs to be proved. I'm not saying that an everyday charity run / carpool is going to make your life better. But just being a 'good' person in general will. >> The Golden Rule: do unto others as you would have them do unto you. It doesn't take half a brain to realize that when you're doing something that makes you feel uncomfortable...it is most likely a 'bad' idea. If you believe that arguing with someone about something or another is going to make you feel better and MAYBE change someone's perspective (for the good), then I would consider you a religious person. If you were to get shot in the head for arguing with that person, then I'd say you've done good just for the fact that 'evil' has been exposed and soon they will be exposed.... like a butterfly effect or something. Like I said... religion is so abstract.. it would take something like a bible to explain it. Actually, a near death experience can't hold a candle to the bible IMO.
  22. Zane

    Religion

    That's kind of oxymoronic don't ya think. Atheism isn't a religion and preaching it would just mean an atheist scrutinizing a room full of theists. That aside, I guess I'm more of an agnostic .. or a christian/baptist that doesn't go to church.
  23. while($news_row = mysql_fetch_array($get_news_query)) $news[] = $news_row; return $news; then do as thorpe told you
  24. you've got 'countkey' in single quotes. The should be in between backticks... or better yet.. nothing at all. This being since it is a column in the table i.e SELECT * FROM prices ORDER BY `countkey` DESC LIMIT 1 or SELECT * FROM prices ORDER BY countkey DESC LIMIT 1
  25. do a print($radio_array) as see what that gives you... and what error is it throwing exactly
×
×
  • 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.