Jump to content

dannyb785

Members
  • Posts

    544
  • Joined

  • Last visited

Everything posted by dannyb785

  1. ok,i kinda get you.. so how should i go about calling the function? so what I said didn't make sense? Are you new to php?
  2. yea, just put some sort of identifying measures to make sure users don't try to run the script(if they know it exists). something like if you know it's supposed to run every 30 minutes, do a check to make sure that when it's execited that it really is 2:30 or 2:00 and so on. otherwise, there's no reason why not to use a cronjob
  3. you changed what to updateDetails()? you didnt delete the function and then try to call it, did you? edit: post the exact code you changed it to
  4. I agree completely. Because in my experience, the fieldset/legend/etc are interpreted differently by different browsers. Check how it looks in FF, then IE, and then safari. I almost guarantee it wont look the same.
  5. For $25, I bought 'php and mysql for dummies' and I kid you not, was an amazing starter for me. You can probably get it cheaper, and dummies books are awesome at explaining concepts that more advanced books don't even cover. And they make it enjoyable to read. After that, I recommend any of the o'reilly books that are php related(they always have different animals on the cover) and then recently I bought the 'php 5 and mysql bible' which covers pretty much everything. Overall about $100 spent on books. and STUMBLE!!! often. If you dont know what it is, download FF and do a google search. Select 'web technology' and 'programming' and you'll gain invalueable knowledge from blogs, tutorials, and the like
  6. Yes, it's not too bad, but just like creating dynamic links(so that youd have to insert a closing </a> at the end) basically, whatever if statement you use to create the div, you need to use the same to insert the closing </div> wherever it would be inserted, if needed. so maybe something like this: if( $open_div == true ) { open div and do some stuff } blah blah whatever else if( $open_div == true ) { close div and whatever else you might need to do to finish it off }
  7. You've defined a function, but havent executed it. Either remove the "function updateDetails()" part(and the opening and closing curly braces) or just do updateDetails(); after the closing curly brace.
  8. 2 errors I caught... retufn preg_replace($headers, '', $string); needs to be 'return' $query = "INSERT INTO submissions (name, email, topic, comments) VALUES ('$name', '$email', '$topic', '$comments',)"; remove the very last comma after the $comments' just before the closing parenthesis
  9. Exactly how i learned. IMO it's better than making a thread on a php forum every time I have an issue... but to surf google(and stumble... everyone should stumble!) and figure it out. Think about it like learning guitar. Are you gonna go out and buy a $3,000 guitar as a starter? Because what if you lose interest and stop caring.. even if you could sell it, you wouldn't get all your money. Or worse if you screw it up accidently(or drop it or something), then there you go. So you buy a guitar for a few hundred bucks, learn it, love it, then upgrade. Similarly, if you've never done php or coding before, it'd be almost stupid to get VPS or a dedicated server to start off with.
  10. You guys have said multiple times you don't see why people still use shared hosting. There are many reasons why: 1) newbies. Some of us start out buying webspace without even knowing php or other languages. So the thought of us paying any more than $15 or $20 a month for something we don't even know how to use isn't a comforting thought. (especially since shared hosting usually charges up front so a payment of over $200 for something we don't know much about isn't a good feeling). 2) affordable. Some of us flat out don't have $50/mon to spend on a hobby. Paying only $5-10 a month makes it so that even if nothing ever comes of our website ventures, we really didn't lose much. 3) ease of use. Yes, if you know what your'e doing, you can install the awesome new php 6 and newest mysql versions and all that good stuff. But in reality, most of us(even most php coders) have no idea how to do that. Yea, you may say 'well you should learn' but when we're spending time learning php, creating a website, and whatnot, learning how to setup a server isn't really on our minds.
  11. ^ did you realize the problem? It's a pretty simple fix. In fact, it's not even an error. You just didn't put an else statement
  12. dude... sorry but... uh.... this is the kinda thing I'd expect from my clients... that they'd be paying me to answer. So much code... yikes... there's gotta be an easier way to do what you're doing....
  13. lol the answer was easy(took me 20 minutes to figure out)... basically... it goes blank because you say "if everything is great, then email... " you have no else statement in the case that email or name was blank. p.s. you shoud also make sure the textarea wasn't left blank
  14. I'd say it's just annoying to a user. They also might not know why the window exited. I'd challenge you to find me any top site out there that exits your window after logout... it's just not necessary. btw, I did the test on my site where I'd logout, and then hit back(in FF) and it redirects me to the login page. I basically have a check_logged_in() function on the top of every single page that requires a user to be logged in, so if the session is destroyed, and you try to go back into it, it will run the function and then redirect you somewhere else.(I'm using the header() function to redirect)
  15. dude,you really should indent your curly braces... it's nearly unreadable as it is now.
  16. ok cool. just making sure the way I code isn't bad.
  17. Okay, actually, since PHP is loosely typed and wants to be on your side, you don't, but it's faster, neater and more proper to use ' '. This is because when PHP encounters a string not enclosed in "" or ' ', it assumes it's a constant so it looks for one by that name. If it doesn't find one, it attempts to cast it to a string, which allows you to use it in that way. But you shouldn't. So don't. shouldn't put it in single quotes?
  18. I should clarify... if you're using the variable within double quotes, then you can't use the single quote. But if it's anywhere else, you need the single quotes. fake edit: I'm not gonna look over all that code.. sorry. I need some kinda error message or line #
  19. how can you tell the session is still active?
  20. when you use an array whos index isn't a number, you need to put single quotes. for example: $row['index'] instead of $row[index]
  21. OK, if you're looking to move it down from the view in FF(personally the position I think looks much better), modify stylesheet.css to #contentwide {position:relative; top:30px;line-height:1.5em;... It moves the entire column down 30px in FF, but not in safari or IE. So that should have you set.
  22. pushed too far in IE? did you mean too far in FF? It looks better to me in IE since the main box(Welcome to..) isn't over the header image
  23. How about my input being ignored? I said that if you're trying to grab pure php code from a php file off of a server, you can't do it. How much better does it need to be put across? I didn't provide a solution bc there wasn't one.
×
×
  • 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.