Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Assuming you have and know a unique id associated with the column... update tablename set user_funds = user_funds + 20 where id=$x
  2. Print and echo are not 100% identical. Though admittedly, 99.999% of the time one is used, the other can easily be substituted, no questions asked. Just a minor nit-pick. p.s.- Good Job. I'm sure he'll get an A on his homework.
  3. <?php $link = '<a href="this/is.html">This is a link</a>'; $link = preg_replace("/(?<!<a)\s/","<br />",$link); echo $link; ?> edit: regex uses a negative look behind to match and replace any space that is not preceded by a '<a'
  4. imagecreate() creates an image identifier, like a resource stream. It's a "black" background because that's the standard "nothing is added to the image yet" background. There's no way to change that initial color. What you would instead do is use something like imagefill to floodfill the image. Or maybe use imagefilledrectangle.
  5. cookies or sessions or passing through the url via GET method. Or through a form via GET/POST Method. I suggest sessions.
  6. I think it depends on who you are asking, as to what makes a 'good' programmer. If you're asking a computer illiterate (the 'other' people in the office), a 'good' programmer is someone who they can go to and say "I need this at this time" and he does it. Who cares how he did it. If you're asking a computer literate person what makes a 'good programmer', it is someone who... who cares. He's probably not the one paying you. The person who doesn't care how you do it, as long as it does what he asks when he asks of it, is probably the one paying you, and that's all that really matters at the end of the day. So the moral of the story is, we can argue all day long as to what makes up a good programmer, but the only opinions that matter are the ones handing out the paycheck.
  7. There was a concern at the last faculty meeting that it would cause a fire, and since safety is a big issue, they opted to ban it.
  8. no. But you can do that with javascript.
  9. so from that example file, you need the stuff in red? edit: oops my bad, didn't read close enough.
  10. what, you mean like, adding id='blah' or class='blah' inside the anchor tag? Or wrapping each one in some div tag or something, where there is css associated with it? Yes. PHP parses code on the server and spits the results out as plain old text. As far as the client is concerned, it looks exactly like you did it. CSS is done clientside.
  11. <?php foreach(range('A','Z') as $letter){ echo "<a href ='test.php?selection=$letter'>$letter</a> "; }
  12. I don't think there's a way to officially retrieve when a cookie is due to expire, but you can do something like this: <?php $name = "somename"; $expire = time()+3600; $value = "somevalue|$expire"; setcookie($name,$value, $expire); ?> And then explode($_COOKIE['somename']) to find out what you set the expiration as and subtract the current time() from it, to find out how much time is left, and use that as the new $expire.
  13. since when is nesting functions elegant? And anyways, that won't work, because preg_match returns the results in an array specified in the 3rd argument. When you try to assign preg_match to something, it just assigns 1 for success, 0 for fail.
  14. Do you have this script included in some other script that has output before the header?
  15. I see what you're getting at, but one would hope that the text is going to be more than 25 words long in the first place, from a content population PoV (that is, one would hope that one is not submitting 25 word articles (or whatever) in the first place...). But nonetheless, if you do want to script for that, you're not accounting for the possibility that it could be say...20 words.
  16. by...putting a reset form element in it? <input type = 'reset' value = 'reset form'>
  17. $result = mysql_query($query, $dbConn) or die(mysql_error()); any errors pop up?
  18. use action = '' to post to the same page. Do value='$_POST['formelementnamehere']' in the target form element. Use html to set the font.
  19. if your $item is always going to start with the dimensions... preg_match("/.*\"/",$item, $result); echo $result[0];
  20. handling file uploads
  21. <td><a href="confirmDelete.php?recordID=<?php echo $row_rsRecords['ID']; ?>">Delete</a></td>
  22. His spacing is fine. the quotes are around his href link. He just forgot to close his php tag. edit: erm..okay his spacing is not fine. Take out the space after the _
  23. Actually it's more of an ajax question.
  24. We don't really use the internet for much i don't think, IT just like to be up to date with things lol. Sounds more like your IT dept doesn't have much to do so they install new things every chance they get, in order to justify their jobs to people who don't know any better.
  25. /<(select[^>]*)>/ will grab everything between the < .. > if you want something more specific then as ddrudik said, be more specific.
×
×
  • 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.