Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. YOu posted an awful lot of c.... The problem is on LINE 20. Look at it and then figure out why your db connection or your query is failing you. That is the problem. Do you have error checking turned on?
  2. Are you going to register this copyright too?
  3. First change the while to an if. Then put all that at the top of your script and only execute it if your detect that the POST method has been submitted. If not, that's when you fall down to output the html part.
  4. It is not really php code. It is echo's of html code and no real logic - none of which fits your topic title.
  5. I still don't see any php code. Getting bored. Good bye
  6. PUT your php at the start. Save the html for the end. Your php code embedded in the options is wrong the "choice" will be Pi or econs, not Option1 or 2 or 3. Basically , the value value. You will not have a $_GET value. Your form is using POST
  7. I can't imagine what your code looks like.
  8. Where is the input value for the user's number? And where is the php code that is processing your html ?
  9. I would write a script that starts by testing if the form is submitted. If it has been submitted I process the inputs setting php vars with their values. Once done, I can now send back the html page with or without the data values that I extracted from $_POST along with any other info. I keep the output of the html code at the end of my script and just fall into it when ready. (Actually I bury my html page code all in a php function that does my entire output of the html to make it easy to isolate. Any dynamic html code (an html table of results say) I pass into it with an argument in the function header and place the arg where it fits in the body of the html.)
  10. Looking at your last set of code I see you will still have the same problem with the lockedcard part. You need to use isset on it before trying to see if it has the value you are looking for. And - no - I don't help someone if I don't know what I am doing. I politely say 'No - I can't help you.' and leave it at that.
  11. If you have no knowledge of Ajax I'd recommend the easy way. Make sure you have php vars setup in your html input tags. That way when your script grabs the data from there those values can be sent back out once the script is done and the screen will look pretty much the same, although I would imagine you would add some kind of message saying success or failure. PS - I think you may have a table design problem. You are probably going to record these bookmarks for an item, hence the itemid (don't use mixed-case!). But don't store the username on the same table as these records. Create a users table with a userid and a username and whatever else you want. Then create a bookmarks table with the itemid and the bookmark value and the userid only. That's how a true RDBMS is designed.
  12. So why are you doing this? Do you also pull apart your car's engine to work on it without the knowledge? Programming is not easy especially if you don't begin at the beginning.
  13. I mis-read your newest code sample. Why do you not do a check of lockedcard item with the isset function before seeing if it has a value? That is the problem. You can't check the value of something that doesn't exist.
  14. YOu are inserting a row into a table that has a single column that contains a 1. That's it? A completely unrecognizable piece of data? As for remaining on the page. Well - an ajax call would do this for you but are you ready for that? The alternative would be to submit the form to your same script that produced the page, do the logic to update the db and then send back the same page that you had with all the data items in their approriate fields again. Do you know how to re-display a form with the input data that use put into it before submitting it?
  15. Very nice looking!! Now you have to research why you haven't set up the variable $_SESSION['lockedcard']. All the others have been declared/set but that one hasn't. Is it perhaps mis-spelled?
  16. You posted this: if (isset($_SESSION['cartid']) && !isset($_SESSION['lockedcard'] || ($_SESSION['lockedpaypal']) && isset($_POST['cartitem']) && isset($_POST['quantity']) && is_numeric($_POST['quantity']))) { & get this PHP error :-Cannot use isset() on the result of an expression (you can use "null !== expression" instead) If you look at the manual it might make more sense. The isset function can work only on variables. It cannot work on the result of a calculation. Think about it - the function tells you if a variable has been declared. If it exists. If it is set. Simple huh? So you have this in your statement: !isset($_SESSION['lockedcard'] || ($_SESSION['lockedpaypal']) which is calling the function with an argument that evaluates to a boolean value. That is NOT a variable.
  17. You have been given an error message. Stop doing what it says you are doing. You can't use isset the way you are trying to use it. BTW - try and write statements that don't run on so long. There's nothing wrong with making your lines shorted so that they are more readable instead of running off the page/screen. Use the enter key to keep them in view.
  18. What is a "second page"? Is it another web page being sent to the client? I don't know how you define "page" since there are no real "pages" on web displays.
  19. I re-arranged your long if to make it easier to interpret: if (isset($_SESSION['cartid']) && ( $_SESSION['lockedpaypal'] != '1' || ['lockedcard'] != '1' ) && isset($_POST['cartitem']) && isset($_POST['quantity']) && is_numeric($_POST['quantity']) ) { if ($_POST['quantity'] > 0) { You have what looks like an index being used without a containing element. The use of 'lockedcard' is invalid. Do you have php error checking enabled? That would help. error_reporting(E_ALL); ini_set('display_errors', '1'); Place at the top.
  20. Proves nothing. My original post is still the problem you need to research.
  21. I don't see what that "con.php" code you just posted has to do with this particular constant.....
  22. But where does that constant (ABSPATH) actually get setup? Apparently the set of modules in use during this process is missing something that sets the constant up. Your other uses must be setting it. For some reason this use is not doing that. Something's missing.
  23. What do you mean by 'ghosted out'?
  24. On second thought I think I will just un-follow this topic. I can see there's a failure to communicate here.
  25. This code of yours is totally unreadable. Don't you get it???
×
×
  • 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.