Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. I've gotta agree with the masses.. An ILMV's right about the clock, IP and how many visitors you've received - they're pointless content fillers. A good tool to use to test how your website displays in different browsers is browsershots.org .. Not to be harsh, but I'd consider remaking the design. The colours are awful.. Google for "color scheme generator" - plenty of tools out there to help you create a nice fitting colour scheme. Also I'd get rid of the XAMP fav icon! A
  2. In my opinion I learn best from reading online tutorials, books, etc. I don't think I'd personally benefit from an online course, but everyone differs in their learning - take an online learning style quiz if you're not sure of yours. I've never take a web development course / lesson in my life, yet I work as a web developer. I think with the scale of information you need to learn in order to become a confident web developer - capable of setting up such e-commerce and complex systems - I don't think there's any quick route into it. Takes time to simply get the massive amount of information in your head; to learn the syntax, logic, functions, etc. So whichever option you choose it will be a long process.. But online resources are free! A
  3. You're correct. I'd say in your situation best thing you could would be something like: <noscript><meta http-equiv="refresh" content="0; url=non_js_page.php"><a href="non_js_page.php">Non-JS page...</a></noscript> A
  4. Check the values of the two $_POST vars.. die('amount: ' . $_POST['amount'] . ' item: ' . $_POST['item']); .. Make sure they're what you expect! A
  5. Try adding this .. window.onload = function() { var lastDiv = ""; } instead of just lastDiv = ""; .. A
  6. What does the error console say? A
  7. There's more than talk of it! http://en.wikipedia.org/wiki/PHP-GTK A
  8. HTML form's aren't necessarily bad if you want to control what's modified, but you need to be careful with security. What you need to look into are MySQL queries and PHP. A simple UPDATE query performed in PHP: <?php // assuming you've connected to the database $query = mysql_query("UPDATE numbers SET num + 1"); ?> I can't ever think of a reason why that query would be helpful but, illustrates the point. "numbers" is the table name, "num" is the field. http://dev.mysql.com/doc/refman/5.0/en/update.html EDIT: Forgot to mention that when you see values in the URL such as "?this=xx&that=yy" .. You return their value in PHP with: echo $_GET['this']; echo $_GET['that']; Lemme' know if you get stuck! A
  9. You're obviously trying to create a template system. There are many, many ways of doing this without the need for custom functions. It would seem you are just including specific files for the page, for example: templates/main_view.php Unless your system gets really robust - in which case you'd be better at looking a much more sophisticated template system, perhaps even using something like SMARTY - I'd try and keep it simple. Perhaps store the template info in an array or database? That way you can search the array/database for the $show val (i.e. music / main) and return some data such as the 'title' or 'src' of the template... A
  10. Adam

    Mysql help

    $user="printf ("%s", $myrow["username"])"; This is all wrong. Syntax isn't correct, sould be: $user = sprintf ("%s", $myrow["username"]); But there's no point at all in using sprintf here, just use: $user = $myrow["username"]; A
  11. <?php include 'config.php'; include 'opendb.php'; $query = "SELECT content FROM images"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo '<img src="' .$row['content']. '" />'; } include 'closedb.php'; ?> A
  12. $num = 10; for ($i = ($num - 5); $i <= ($num + 5); $i++) { print $i . ' '; } Not tested but should work .. A
  13. Think he's trying to determine if it's positive or negative? ??? If that's the case you don't need to use some special operator, would just be: if ($num == -5) { print 'Negative!'; } elseif ($num == 5) { print 'Positive!'; } Please explain a little further what it is you're trying to achieve.. A
  14. Well if that code is run every time the page loads, it's bound to say that? A
  15. Yeah definitely. You still need <?php ?> tags around your included code though, could that be the problem? If you do already, it's just a syntax error - look what line and file it's in either try and fix it or post the surrounding few lines.. A
  16. By the way you could condense: if (!isset($_GET['show'])) { $show = "main"; } else { $show = $_GET['show']; } Into: $show = (!isset($_GET['show'])) ? 'main' : $_GET['show']; Though you may want to secure your $_GET/POST vars in future!
  17. <?php include('templates/header_view.php'); include('templates/navigation_view.php'); function pageTitle($arg) { switch($arg) { case "main": $title = 'main'; include 'templates/main_view.php'; break; case "music": $title = 'music'; include 'templates/music_view.php'; break; } return $title; } // check for main if (!isset($_GET['show'])) { $show = "main"; } else { $show = $_GET['show']; } $pageTitle = pageTitle($show); // End include('templates/footer_view.php'); ?> Something like that? A
  18. Well yeah, that's a fair point. Thought the diagram, after you take 5 minutes to understand, isn't really all that complicated! I'm fairly new to regular expressions and find the tool useful to validate and check that it's what I'm trying to achieve. If there are any errors or problems it would help me identify the problem. I find it difficult - as I'm sure many others do - to visualize a complicated, long expression. Perhaps this is more useful to learners? A
  19. [a-zA-Z0-9][\w\-]+ That's perhaps more correct? As I said, regular expressions aren't my strongest point!
  20. [a-zA-Z0-9][\w\-] A
  21. A better way would be: [\w\-] By the way i don't think ^ should be in there? I'm no regular expressions expert, by far, but i believe that means NOT these characters. Anyone?
  22. [^A-Za-z0-9\-_] A
  23. try this: $result = mysql_query($query) or die(mysql_error()); A
  24. Try: var oldurl = location.href; A
  25. As maxudaskin says, it's not a very original design. You claim have to this brand new unique software, but to me it just looks like wordpress. Don't get me wrong it's a nice look, but definately been done before! Reading through a few of the posts there are a lot of spelling and grammer errors too by the way. A
×
×
  • 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.