Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. When you use the word 'session', are you talking strictly about the actual PHP Session or just some data items that you are using to identify the user? If I understand it correctly, a PHP Session is destroyed (soon) after the browser is closed. If you are simply worried about any ids contained in that session, they will go away soon, as said. If you are talking about some other info that is contained elsewhere then you need to perhaps store the session id in that db entry so that you can tell if a user returns but doesn't have the same session id anymore. Of course it none of what you are writing about is at all related to the PHP Session, then let's start this conversation over and tell us what you are really doing.
  2. If you create the an array with the source points being the element keys and the dest as the corresponding value, you can then use array notation to get what you need. Start by finding the value for the array key that matches your starting point. Then take its value and use it as the key of the next path and continue until the value matches the destination you want. Kinda pointless now since you most likely failed the interview, eh?
  3. Actually the message is saying that $dbo is not an object. Since we can't see this code I can't say anymore. Also - remember that PHP is CASE-SENSITIVE so referencing a variable like $Row is not the same as referencing $row.
  4. If you turned on error checking you might get some messages.... As for the first error I see: Your include references a string of letters that PHP cannot interpret. You must always put text in quotes unless it is a variable or a constant or a name of a function. include("filename.php"); would be proper.
  5. Table 3 is unnecessary . You should merge it with Table 1
  6. Your pool runs for multiple weeks, no? So how will you handle the data for each week for each user for each pick? Does the gameId have any indication of the week? The best way is to do a query that pulls all the data together for you. Such as the data from table 1 and the date from table2 in one query result. Of course I am assuming that table 23 does have the gameId in it. I am confused as to what 'assigned points is in table 3
  7. Since http file uploads go to a temporary folder on your server, your php script that is 'receiving' it for you can simply use the proper function to move the file from the temp to the final folder of your choice. Assuming that you have truly done an upload using a webpage then the simple answer is to use the function move_uploaded_file() (look it up in the manual).
  8. Way too complex code to wade into without any help from you. Don't you ever use comments to describe what all you are doing? And what is an "out some" that you say you are looking for?
  9. This forum loves to help those who help themselves. With that point clear - until you show an ability to write SOME code, people here usually will not give you code help. If you can't code already then it really doesn't help you for us to give you one line of it. A point to consider is that the button would submit a form to your script that then grabs the input elements hidden in your page's form. If you have multiple sets of info on your webpage, you may have multiple forms embedded in, each one with a button that submits its own form, passing the data needed to the download script. If that makes sense, happy coding!
  10. It is ALWAYS good programming practice to check the results of operations that can impact your own process. If you run a query you should always check the result of it before trying to use the query results (check the PHP manual for examples on how to use the query function). If you open an external file you should check that the open call actually worked (see the manual again for 'fopen' for examples). That way you avoid running into problems later on in your scripts. In this case when you make those calls to Google (an external source!) you should be checking the response to make sure it worked. And when it doesn't work you should know how the source is returning any important info that can help you (check your API instructions/manual). That is what scootstah is trying to tell you. Other things that you can do are to turn on PHP error checking during your development cycle (see my signature) and when really stuck look at the php error log file on your server for any messages that may be posted there (google 'php error_log').
  11. Dislike plus 1 here! So the user now has a slew of vars containing his data. Just what he wished for. Now what does he do with them? How does he find anything? Is this original array a static set of data - never to change or be re-sized? With all those var names what kind of (complex) code is he going to have to write to find anything? Moreso - with var names that have nothing to do with the specific value that they hold how WILL he find anything? With an array at least the data is easily accessible. It may still be unrecognizable as to its true meaning but at least it will be find-able.
  12. It appears that you have a series of numbers sorted ALPHABETICALLY and stored in groups of 6 values. What it is and why it is stored that way is a mystery, but apparently necessary. As for re-arranging it - do as Requinix said - don't! You already have a perfectly valid (tho limited) data structure so use it. Instead of $array1 you just reference $array[1] or to get individual values $array[1][0],$array[1][1] and so on. Read the manual on arrays to help understand arrays if you need to.
  13. At age 63 I have a lot to offer too. Unfortunately you don't seem to be reading what I'm saying. My questions/points are all valid and you don't get that I am trying to help you debug the problem. My first post was nothing but helpful, but you chose not to address my issues in a positive way. Since you have plenty of time to spare (as do I), I'll leave you to ponder your code and solve your problem now. I tried. Ho hum...
  14. You want to copy someone's work? And you expect us to help you? If this was for a legitimate purpose I would expect you to have help from the author. Since you don't (obviously) then it appears to be illegitimate and therefore I will not offer you help. I hope other well-meaning forum members understand what they may be doing should they offer their two cents.
  15. 1 - you still don't get what I asked about 'root'. Since you didn't say it was a PHP constant I have to say it is invalid code which should stop your script from working properly. 2 - you copied "this" from the manual. What are you referring to - the function? If you know anything about functions then you know that it doesn't execute by itself. It has to be called. You should have tried to understand what you were copying and made sure to copy a call to that function. 4 - Defeatist? How about "wasteful"? There's another term that could be used. You are switching because you think you have to. All I did was repeat what you have already been told and added my $.02. You don't have to recode this - and spend this time more fruitfully by trying to learn some basic php. If you haven't done so already, plagiarize my signature and add that code to your script. You should get a few more warnings and notices from your code. As in the use of $row for one of your query processing lines. $row does not exist. $Row does.
  16. Why do you need a loop? You have a date value and you changed it to the format you wanted without one. Why a loop? Perhaps you should show us the form?
  17. 1 - What is "root"? You use it in your connect statement but what is it? A string? A constant? It's not a var. 2 - As already said - you never call the function that you wrote. 3 - The word is "deprecated", not depreciated. Two entirely different things. 4 - As also said - if you have a working mysqli model you do not have to change a thing. 5 - You are using a foreach to process your query and loop thru it. I find it very confusing to read and frankly am not even sure it works that way. A simpler way of doing this is to execute the query (and check the results for false before proceeding) and then to use a while loop as follows: $qrslt = $conn->query($Rel_Hol_sql); if (!$qrslt) { echo "Error running query"; exit(); } while ($row = $qrslt->fetch(PDO::FETCH_ASSOC)) { (handle your row here) } Don't know what you are referring to when you said you downloaded and read a manual and found it to be too technical, but this business is all about being technical. If reading the manual is already too technical, you are in for a long tough row to hoe if you choose to continue this effort.
  18. Add a test on the query result to be sure it is True and not False. Also - your query selects some fields without a table qualifier. Are those fieldnames unique? Also - why would you want to retrieve the password? If this is a general query and not a logon query, why do you want to expose the password?
  19. Or you could post on the forum that caters to paid services, not here.
  20. People are trying to help you program like a professional and you're wise-cracking? Say good-bye.
  21. The use of $_REQUEST is not recommended. It is far safer and better to use what you actually expect your data to arrive in. If the form uses method='POST', then use $_POST. Same if it is a GET request. Use $_GET. Hackers could do something with a get while your script expects a POST and by using $_REQUEST they can still get into your script. Why use the ambivalent $_REQUEST when you know what it should be? If English is your primary language, why do you write such poorly composed posts?
  22. Like mac_gyver says - learn what you are copying before you try to use it. If you "find" some piece of code, look up every part of it in the manual to see what it is doing and to LEARN from it. Can I ask: Is English not your primary language?
  23. In one way it is rather deficient. It is recommended to NOT use $_REQUEST as a catchall/shortcut for accessing your expected input. If you are expecting $_GET input then USE it to get it. Same for POSTs - if it is supposed to be coming in via the $_POST array, then reference the $_POST array. One less way for a hacker to get the best of you
  24. Do you not even know how to write plain text to communicate? Of your last 4 posts above this one, the first 3 make no sense at all! And the latest one is fraught with errors even while trying to teach something. Are you trying to tell the Forum about the dangers of trusting user input? I think most people here already know that and try to impart that to those that don't. PLEASE try and learn this: Do Not Use $_post. It is not what you think it is! One of the first things about PHP that you will learn if you ever really try to learn it is that the language is CASE-SENSITIVE.
×
×
  • 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.