Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Yes, it can.
  2. $file = "bb.xml"; $read = file_get_contents($file); Simple as that.
  3. Reported. I think you mean TDLR; Reported. Bump. I need THIS CODE WRITTEN URGENTLY: PLEASE WRITE ME A SCRIPT THAT I CAN UPLOAD PICTURES TO AND POST THEM ON THE INTERNET FOR FREE. THANK YOU!
  4. Reported. I think you mean TDLR; Reported.
  5. Why would you quote an entire post that is already in a thread? Can we not read it above? EDIT: Reported the above post. foo Reported.
  6. phpSensei, please see Forum DON'Ts #12: http://www.phpfreaks.com/page/rules-and-terms-of-service Why would you quote an entire post that is already in a thread? Can we not read it above? EDIT: Reported the above post.
  7. You have a syntax error: $message="--- Incorrect Username, Password, or You Are Trying To View At An Incorrect Time ---"; That will fix that syntax error at least.
  8. Perhaps your new setup has short_open_tags removed. Try changing <? to be <?php in both places. If that is the problem, this "should" fix it. But something tells me it is not Also make sure that your error_reporting is set to E_ALL for development and "display_errors" is set to on: <?php error_reporting(E_ALL); ini_set("display_errors", "on"); This will inform you have any errors PHP may be having.
  9. Because you are redirecting the page before it has a chance to run the mysql query? if (!mysql_query($sql)) { die('Error: ' . mysql_error()); }else { header("location:add_new_product3.php?id={$item_id}=username=".$_SESSION['username'].""); } Should do the trick.
  10. if(!isset($_SESSION['username'])){ // if session variable "username" does not exist. Would be the proper method to do it.
  11. Sounds like an easy item to accomplish. Do you have any code that you have attempted? Or perhaps have you tried to google for pre-existing scripts that have this already built in? Such as this site: http://www.nodstrum.com/2007/09/19/autocompleter/
  12. If you are putting this into MySQL, you can have the column type be TIMESTAMP or DATETIME and just use the NOW() function, better to handle the time inside the database and save yourself the hassle of doing it in both places, imo.
  13. For category pulling, there is no real "clean" way to do it. The only thing you can do is "cache" the categories in a few different ways. A: Pull them once at user's first view of the site and store them in session. The issue here is that if you update a category, the user's data is potentially out dated, so you would need to figure out a check, maybe a hash in a "status" table of category_last_updated. If it is not this hash then re-pull the data. B: Similar to method A but store the categories in a "cache" file in a serialized array / object. Then just update this file when you add a category and it should keep the user up to date automagically. I am not sure how bigger sites do it, but I would imagine some type of a cache in session or in a file with a serialized array. I would choose the "cache" file, imo. Then you would just have to tailor your code to loop through an array recursively. Is this any better, I have no clue. But it sounds pretty fun to try.
  14. The only thing I can think of is where you assign the session username. $_SESSION['username']; // Create session username. Change that to: $_SESSION['username'] = $username; // Create session username. The session_register problably set it to "" so if you did not want the username stored in that this would also work: $_SESSION['username'] = ""; // Create session username. Not sure why that would matter though, unless live.php tests for the session username and if it is not set redirects you back to that page. But give that a go.
  15. Have you checked to see if magic_quotes are on? If they are, they automatically run addslashes on any form data. It is suggested to turn them off / disable them (see the documentation on alternatives to this).
  16. do a var_dump on the $size variable. See if the size is coming out. If not, set it to a manual size that it should never hit like (1024*1000) or something. That should cover you. Or to read it, just do a file_get_contents before the fopen, then you do not have to worry about it.
  17. What was the point of quoting your original post? Afraid that we would not be able to see it?
  18. You could just strip all non-numeric characters and then format it how you want. As long as you are always expecting 10, you can format it how you want it: $num = preg_replace('~[^0-9]+~', '', $phone_input); Then you can use substr to put it back how you want, or even use preg_replace again to format it how you want. IE: $formatted = preg_replace('~([0-9]){3}([0-9]){3}([0-9]){4}~', '($1) $2-$3', $num); Un-tested, but should give you a working theory / something to build off of.
  19. This still produces the error: $file = "bb.xml"; $size = filesize($file); $act = fopen($file, "r+"); $lock = flock($act, LOCK_EX); $read = fread($act, $size); If it still produces the error, is at any point this file deleted?
  20. Chances are...no. Given that I do not see anywhere where an include is to define the function. You are better off contacting the makes of the CMS and asking them about it / searching their documentation for similar issues.
  21. You would use sessions. But this will only work for the current website (ie domain.com) and any pages that have the session_start at the top. But that is what you are probably wanting to look into.
  22. Send her to googles blogger service and call it good. My wife "wanted" to build web pages but didn't want to do the leg work, after a week of her frustration, she just went to Blogger and used their service. The place to start, basic HTML / CSS. Then once they get a good handle on that, move on to bigger and better things (if they get the handle on that).
  23. Well it probably has to do with the path, but not 100% sure (could also be due to the lock). Why not just read it all in with file_get_contents instead before you lock it or get the filesize before you lock it. Either or should work.
  24. ... RewriteRule (.*)_(.*)_(.*)_x_(.*)\.html index.php?go=at&ID=$1&Cat=$2&other=$3&another=$4 [L]
  25. RewriteRule ^(.*)\.html$ $1.php [L] RewriteRule ^(.*)\.htm$ $1.html [R=301,L] But why not just rewrite .htm and .html to php permanently?
×
×
  • 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.