Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Can you show us this call? That would be so much easier to debug than taking a flying leap at whatever you are talking about.
  2. You may be trying to avoid some work here in order to make this necessary change, but you eventually will have to do a whole lot of work to Stop using the deprecated MySQL_* functions and move to mysqlI or pdo.
  3. Cronix - Not familiar with array_fill_keys() nor range() but after reading the manual I think there is a flaw in this. Your range will produce a set of values ending with whatever is the highest EXISTING key in the array. Then array_fill_keys assigns a 0 value to all of the indices in the range set. What about the days that were not in the original array higher than the existing max day?
  4. for ($I = 1; $I < $lastday; $I++) if (array_key_exists($I,$ar)) echo "$I is $ar[$I] <br>"; else echo "$I is 0<br>";
  5. your code is impossible to read. What did you do? Did you even look at your post to see it?
  6. Why not follow the instructions you have been given? Use phpadmin (?) and create the db and then create the tables your instructor says you need?
  7. People Have been very specific. From the get-go! OP - Run one query at a time to make sure you are doing it right. Simple as that! When you are confident in your skills, take the next step and run multiples. Simple as that. From the sidelines I've seen everyone say the same stuff and you are not listening at all!
  8. May I ask how a proposed php login is going to secure your "game"? Is this game written in php and did you write it? If not php, how will a php login interface with it? And if it is php, how will you write the code to ensure the user did in fact login.?
  9. So now you have some error messages to be resolved.
  10. Way too much code here to look at. Is that a dump of your data? Uhh....... Exactly what is not working? Are you getting errors? PS - tried to copy your code into my ide and find it has no carriage returns/line feeds. Can you perhaps post something a bit more presentable?
  11. Something is wrong with the code you are showing. Your assignment of $username is NOT in your query statement so what you are showing makes no sense since it can not be an sql error. We need to see the code before the $username= line to see how the interpreter is seeing it. For some reason it thinks that line is part of a query, so I think you have some previous code that has not been entered correctly.
  12. You can use explode to split up the query string into each "var=value" component. Then loop thru the resulting array and explode each of them into the var name and the value. $args = explode("&",$the_url_string); foreach ($args as $arg) { list($var,$val) = explode("=",$arg); (do something with this var/val pair) }
  13. I see a bunch of code that is apparently the contents of your html form (php does not have forms). So - why are you not adding the necessary 'table' html to this? Isn't that what you want to do? This chunk of code seems disjoint. You prepare a form and then you send an email. Odd stream of acitions.
  14. 1 - the two lines of code you show do not make sense to me. These are not proper url strings, nor are they proper php code. Please show the entire line in your script that generates this if that is what you are showing us. 2 - When you say you can echo stuff and see correct stuff, just where and when are you doing that echo? In the same script that creates it or in the script you are calling with this url? 3 - retrieving the data from the url? I assume you are now talking about doing this in the script that you mention in the url itself (as you have showed us). $_SERVER['QUERY_STRING'] would be the value you can use for that I believe. Perhaps with a urldecode command added to the result also.
  15. Is that supposed to be '?php=Contact-Us' ? Look for lines beginning with 'include' or 'require'. Those are files of code being injected into the main script that probably contain what you are looking for. Add an echo statement in front of each include and then run it in your test environment to see what shows up before the content you want to edit.
  16. I wanted to know the name of the script you showed us in case IT was the script that was what you were seeing unexpectedly. (Since your form tag didn't tell me.)
  17. One question at a time. Where to put the code in your web page?? Well - technically you don't. You place it in your php script. And that can be done wherever your logic dictates. It's up to you. Just realize that you won't 'see' the cookie until your script loads the next time. You receive the page, grab any inputs that arrive in the POST/GET array, decide what needs to be done, and if that decision includes setting a cookie, then you set it.
  18. And where is the line that is sending you there? And what is the name of the code you are showing us?
  19. Try using 'pathinfo' to break apart a fully qualified filename. Then apply your replace work on just the filename portion, and not the path
  20. Wrong. 1 - programming is all about writing a program to handle data and produce from one place the desired results. It is not about writing a custom piece of code for each user. 2 - What you are describing is data that will drive the client's experience. Store that data in a db and use the user's id to identify it. User logs in; script gets login (and validates it!!) and then uses that login id to go query the db for all the data pertaining to that user and outputs it to a webpage from a common script using variable data.
  21. What IS wrong? You don't give us any reason to suspect anything is wrong with this code. Do you have messages or results of any kind? Put some echo statements in the code to see what is happening. PS - Turn on PHP error checking to see if you have something in your code that doesn't work in your new php environment.
  22. Why do you have display errors on? Won't that display to your console as well as your log? Why do you have @ in front of those commands? You don't want to know about any error that may occur? Are you sure your script has access to the desired error log location? Is there in fact a log file to view? How about logging your progress as your script proceeds? Maybe it's a particular site that is killing your script somehow.
  23. This code is : 1 - too incomplete to analyze your problem. Where was $users defined? Dont' see it. 2 - for a newbie you sure have some knowledge of little-used syntaxes. Why don't you use the more common (and preferred) syntax for 'foreach' and 'if' instead of the ones you are using? Would make it easier for you to read and follow as well as for others. 3 - please post code properly should you decide to give us what we need to see
  24. Wrap your mod test in an if that tests if $I is not 0
  25. You also need to turn on php error checking so you can be warned about your syntax errors. This statement: echo "<b>"$row['name']. " - ". $row['age']"</b>"; is faulty. You have a string followed by a var name which the php interpreter is not going to recognize. You have a var followed by a string at the end. The interpreter is not going to accept those situations. This: echo "<b>" . $row['name'] . " - " . $row['age'] . "</b>"; will work.
×
×
  • 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.