Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. I'd recommend an e-commerce related solution, As a CMS anything higher will cause confusion and won't integrate well the shop portion. Zen-cart is a first choice of mine for it's (well, price being free) and easily modifyable for a client, although it really depends on the size/scope of the store. I've seen many zencart based sites do well though.
  2. //After the code print '<pre>' . print_r($grid, 1) . '</pre>'; That should give you a clean heads up of what is inside the array. Does grid[1][5] Exist in the outputted content?
  3. Apparently on line 42 there is a non-object.
  4. You could place unique code on just login.php: if (isset($_SESSION['id'])) { print "You are already logged in!"; exit; } else { //<form .. log in form. } Of course that is only a crude example, but as you see it's fairly simple to implement. Once the session is set, It will not let them 're-login' and it will bypass the checks on other pages as the session's ID value will be there.
  5. Should be fairly simple and straightforward. <?php session_start(); //You need this at top on every page using sessions. if(!isset($_SESSION['id'])) { header('login.php'); exit; //Required } That'll redirect them to wherever you wish if their session isn't set (IE: Their ID). Change 'id' to whatever session variable you use for them when logged in.
  6. A) You're using short tags. B) You're not using isset on $submit. C) You want handling of the form on welcome.php, Not the current page. D) Your obviously incorrect parentheses on the SQL statement.
  7. You can do well and spit out weighted results, for example if you wish "your" add was displayed slightly more, etc. function randweighted($numbers) { $total = 0; foreach ($numbers as $number => $weight) { $total += $weight; $distribution[$number] = $total; } $rand = mt_rand(0, $total - 1); foreach ($distribution as $number => $weights) { if ($rand < $weights) { return $number; } } } $ads = array(51 => 2000, 41 => 5000, 23 => 3000); include (randweighted($ads) . '.php');
  8. GEDIT is a nice code IDE editor that should come standard on some Gnome installations. It has function completion and bracket highlighting (end-to-end) and has done well for me as a lightweight editor.
  9. I'd be holy to watch this thread if I didn't enjoy instant coffee more than brewed, Maybe it's a good curse. The project is fairly generic to others, It should be fun to do.
  10. I can safely assume the user has logged in. Simply place their user name within the current session (as people do for authenticated programs) and you can easily make this: //editdetails.php?id=24 An automated example if ($_SESSION['userid'] != $_GET['id']) { die('You\'re not authenticated to view this page!')); } //Authenticated content Of course that is a mockup example, and you should generate a solid system of how you handle the user's IDs appropriate for what you are doing, but authentication per user is as simple as that.
  11. Yes, Yes you do. And you'd get a lot more replies had you posted this in the Misc. forum, This isn't a post requiring criticism or help on code.
  12. PHP is not HTML, so it can't be used in the same tags. You need to separate them, Let me show you an example of your working code: <html> <head> <title> Login </title> <body> <?php $username = "username"; $password = "password"; $wel = "You have successfully logged in $username"; $get = "Incorrect username or password"; $vardas = $_POST['vardas']; $slaptazodis = $_POST['slaptazodis']; ?> <form method="POST" action="<?php print $_SERVER['SCRIPT_NAME']; ?>"> <input type="text" name="vardas"> <input type="text" name="slaptazodis"> <input type="submit" /> </form> <?php if ($username != $vardas) { print $get; } elseif ($password != $slaptazodis) { print $get; } else { print $wel; } ?> </body> </html> Although it still looks like there are many problems with your structures, You should learn how to use IF statements properly, as I needed to correct quite a few. Try not to list the curly braces ({ }) on new lines, as it seems you're confusing them in the end. For security reasons, also use SCRIPT_NAME in place of PHP_SELF, which will work the same in the end. This code will not work, as you need to look into ISSET for your $_POST elements as well. If you need help on that just ask.
  13. Meh, preg_match on your first code statement would look like this: <?php if(preg_match('/[ *]and[ *]/i', $type)) { echo 'checked="true"'; } ?> Which would match " and " but not "random" or "Anderson"
  14. http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php getimagesize filesize
  15. Why can't you look at the documentation and do this yourself? https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/howto_api_overview We're not going to write code for you, unless there's something specific. You're not giving us a problem. You can go to the freelancing forum if you wish for someone else to write the code.
  16. Your question and example code makes very little sense.
  17. Your old server most likely relies on register_globals setting which has been depricated for nearly ten years. Try running the function phpinfo(); and checking. An example of your code contains: <form name="quick_find" action="http://sgi-int.com/advanced_search_result.php" method="get"> So naturally you can access it through this on the appropriate page: $term = $_GET['quick_find']; If there is anything specific you need help on, I'm sure it'll be better for you and us if you can pinpoint the exact problems.
  18. What exactly is your problem? We're not going to write the solution for you, We can only help you on what you're having trouble coding.
  19. Great work, I quite like you've ported to J2ME to cover most of the phones that aren't the Blackberry or iPhone. Your examples page (examples.ipfaces.org) works wonderfully on my iPhone, It's nice to see such a robust framework, although I can't say I can comment on much more as I don't have much time, hopefully others will see the opportunity
  20. @neo, The point of the next button is to see the next randomized entry, That should be obvious. Anywho, I'd hate to say the pages look great, especially the layout of the recepies (with the instructions and ingredients) with printing as well, But I have an ad blocker on, I don't think it'd look as good if it were off.
  21. That under construction page is good in itself, It shows that you put atleast some effort into appealing with a simple structure, but there's not too much to say about it until it's worked on more. When you hit the Projects page and things, it seems the header is really most of the content, so maybe you should put focus (such as bordering, or styling) to the paragraphs and make the page higher IMO.
  22. All depends on how your server is set up, Adding a handler would show the master ini file was not set up properly with PHP, such as a stale upgrade.
  23. Mod_rewrite should not handle what mod_mime is supposed to do.
  24. No, <FilesMatch "\.(htm|html|php)$"> SetHandler application/x-httpd-php </FilesMatch>
  25. Try this. Put this in your HTACCESS document: AddType x-httpd-php .php .html .htm Clear caches of ALL browsers, make sure you restart each one of them after clearing the cache, and it should work. If it doesn't, What does the downloaded script contain? Your code or is it blank? Try running phpinfo() for any problematic settings.
×
×
  • 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.