Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Read up on the substr function in the php manual.
  2. 1 - turn on php error checking and let us see the lines in this code. 2 - whenever you do a function call that MUST be run correctly, you should CHECK the result of it to ensure that it ran. Modify ALL of your present code to check results and echo error messages where appropriate. Do those two things and you and we will learn what your problem is.
  3. What you want to do is certainly a common enough thing. Simply create your html wrapper with the div and css stylings and then place your php var in the html. Then let the html be output along with that var and you'll have what you want. I usually do this kind of thing by having all of my html in one function (DisplayPage) and then let all my php code happen before calling that function to send all my output - html and php vars that I have created. You can pass the vars into the function with args i.e.: DisplayPage($var1,$var2,$var3), or use global vars (which many are totally against, but they work just fine for me).
  4. Perhaps if you did some research on the proper syntax you would see what's wrong with that line. 1 - indices of an array should have quotes around them. 2 - php variables begin with a dollar sign. Constants do not. If you are in fact using a var here, then you need to fix it. 3 - while php does offer a goto statement but you should know that the use of a 'go' or 'goto' in any language for the last 20+ years has been frowned upon. My suggestion is that you avoid using one like the plague. Structure your code properly and you will find you have no need for this anachronism and in turn you will write better, more understandable code.
  5. Don't understand your issue. Please use code tags to post code and make it more readable.
  6. So - that's your error. A function you wrote?
  7. Are you hashing your password into the db and forgetting that when you try and find it again? Can you show us the error message you are getting?
  8. Why not use your glob call to get a list of image filenames and store it in a SESSION variable? Then display the first x images by getting their names from the session var array? When done also save the index of the last item displayed as a session var. On subsequent executions of your script - if the session vars are set, then use them to pull up the next x number of images until there are no more.
  9. Looks/sounds like an sql question, not something on a php forum.
  10. Simply read and understand what I gave you and then carry it on to whatever lengths you need it to go. Since this is a almost definitely a homework exercise, you're probably supposed to figure out a more elegant method than my brute force one so you should probably put some effort into it.
  11. I don't see a password comparison here at all. PS - Why would one create a form to SHOW somebody's password??
  12. Sounds like a home work assignment. If you really have some code that YOU have written, show it to us so that we may help you.
  13. You still have to have an ajax process hitting the server with each new addition to your search argument. Could be slow.
  14. Because of your penchant to go into and out of PHP mode constantly, your error is because you are building that tag OUTSIDE of php mode. Better script organization and techniques would alleviate the need to use <? more than once in a script.
  15. DO YOU READ ANYTHING I WRITE? I gave you a corrected path to use. What happened when you tried it? And - did you look up the example I told you to check out earlier?
  16. 161 is probably a quote problem above there. 141 you typed something wrong in that line the last - I haven't seen so can't help btw - don't need to use php tags just because you start a new line. This kind of coding: <?php if(isset($_SESSION['user'])){?> <?php makes absolutely no sense at all. You have other instances of this silliness as well Plus - if you are not going to make use of the PHP 'heredocs' feature for your html, then at least break it up into logical chunks to make it easier to debug as you are about to do now.
  17. that's what you asked and that's what I replied. Actually you should be checking if isset and then check for a value. if (isset($_GET['request'])) if ($_GET['request'] <> '') request has a value by the way - using $_request is not safe. why aren't you simply using $_GET?
  18. No - it means it equals 1 (or possibly 'true') As for your 2nd - if it is <> null, then wouldn't you assume that is equal to anything at all?
  19. Are the errors PHP errors or logical errors?
  20. in English you are doing : a) if you have a query string AND the 'p' argument is 1 or nothing you set line 470 (although you left off the quotes on http_host) b) if you have a query string AND the reset argument is 1 AND 'p' is 1 or nothing you set line 474 (and again, you are missing quotes). So - is that what you expect? (Try adding the quotes.)
  21. If you take the time to do your own research and read the manual as I suggested, you will find an example of exactly what I believe you are looking for.
  22. You are looking for file names that match your search word? Look up the 'glob' function in the php manual.
×
×
  • 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.