Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. I mean anything which describes the view. Take a look at frameworks like CakePHP and CodeIgniter to see what I mean.
  2. Using square brackets. Accessing it like an array like I did in the first example. It's only the curly brackets (second example) which are being deprecated. Then again, there is always substr() for getting longer parts than just a single character.
  3. Just have an array of crumbs and use a foreach loop or join() to generate the trail.
  4. Generally I'd say it's best to separate template from the rest of the code. Makes it easier to maintain IMO.
  5. Yes, you can do echo $string{4}; as well, but it's deprecated as of PHP6.
  6. I love string slicing in Python as well, but for PHP you'll have to do with substr() or accessing a single character at a time: echo $string[4];
  7. Semantic markup, cleaner code, easier to change, bandwidth usage reduction, etc.. It also has something to do with what is called "separation of concerns". In web design you'd be talking about three layers: HTML, CSS and Javascript which are content, presentation and behavior. If you use tables for laying out your code then you will have moved some presentation into the content layer.
  8. It looks pretty good actually. I'd probably change the link color. Perhaps remove the border around the "Online Past..." thing. If you want us to take a look at the rest of the site I'd prefer if you created a demo user for us to use so we won't have to register.
  9. I don't really like the background. These repeating background images is kind of '90ies IMO. Choose another font than the default (Times New Roman). I know it still says it is under construction, but the links need another formatting to stand out. There aren't any anchor tags yet, but there are no styles defined to change the way they look either. The paper edges need some work as well, especially the bottom as it just ends. Code-wise I'd suggest you to move to a table less layout. It's not a very complicated layout and is therefore easily changed. If you need help with that you can post in the HTML/CSS forums. Oh, and it's spelled "Copyright", not "Copywrite"
  10. Daniel0

    Null/Not Null

    See: http://dev.mysql.com/doc/refman/5.0/en/null-values.html No.
  11. I've never used XAMPP (I prefer to install the things myself) but I'm quite sure that your htdocs and settings will remain where they are. At least so it is when uninstalling Apache. You could try to backup your setting files and htdocs directory and then attempt to update it using a newer installer. You might have to remove the old version first though.
  12. You certainly don't have to, but it would be a good idea to use a Model-View-Controller approach.
  13. I supposed you had already fetched some data and stored it as an array in $row. Although you can do so you'll fetch it just by doing that it wouldn't be a good idea and I doubt that you've done so. You'll have to get the data from the database like you did on the other page.
  14. I don't think so. It's a PHP forum after all. ActionScript is handled fine in the "Other Languages" board IMO. We can't have a forum to every single language that exists.
  15. Why are there naked women on the front page?
  16. You format it using HTML. Page breaks are generated with [pagebreak]. The code boxes are made with the <code> tag.
  17. You might want to create a function which handles getting a random image.
  18. Where does the $row variable come from?
  19. Ah, yes, target of course. It's a long time since I've ever used that attribute seeing as it is not allowed in XHTML 1.0 Strict. Btw, if this is resolved then please click the "solved" button.
  20. Hmm... I don't think it's Javascript. I'm not sure why it does that. I suppose one would have to look through the code in phpBB - that is something which I don't want to do. You might want to try phpBB's forums. They probably know the code and can give you an answer. Also, why aren't you upgrading to the latest version (3). You might also just want to not use frames, there is no reason to. I'm sorry I couldn't help you.
  21. Well, instead of <?php // ... if ($img!=null) { $imageInfo = pathinfo($img); $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ]; header ($contentType); readfile($img); } else { if ( function_exists('imagecreate') ) { header ("Content-type: image/png"); $im = @imagecreate (100, 100) or die ("Cannot initialize new GD image stream"); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 0,0,0); imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color); imagepng ($im); imagedestroy($im); } } ?> you could do <?php // ... // instead of setting $img to the path you'd set $img to the URL of the image. if ($img!=null) { echo "<a href='{$img}'>{$img}</a>"; } else { echo 'Image does not exist'; } ?>
  22. Just select a random image and link to it directly?
  23. Yeah. That means there is some javascript somewhere which is doing the redirection. Could you post a link so we can take a look?
  24. You'd do $body = $row['noteforstudents']; <?=$row['noteforstudents']?> is shorthand for <?php echo $row['noteforstudents'] ?> (see: http://php.net/echo)
  25. Well, just use the variable in the body and to attributes. Also, please post in the correct forum and use the tags around code
×
×
  • 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.