Jump to content

batwimp

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by batwimp

  1. I can't think of any reason this wouldn't be printing out. I'll keep thinking.
  2. Can you post the output here? Also post the var_dump statement you used to get the output.
  3. Is it possible for you to post your entire code? If it's too long, then at least post the code around where the regex_check_image function is called. I guess I'm not fully understanding how your code is supposed to work. But basically, you want to initialize your variable, which sets a beginning value. It's usually done like this: $counter = 1; If you're using the variable as a counter (which you are in this case), you want to initialize the variable OUTSIDE the code that increments the variable. Otherwise it will set the $counter back to 1 every time it runs the loop (or whatever). If you are (or will) initialize your variable outside of a function, you need to globalize it inside the function (though this is frowned upon, you should really learn about function scope and passing variables or possibly using static variables inside a class). I know this is a long answer, but I may be able to help you if you can post more of your code and explain in more detail what you are trying to do.
  4. Put it inside the function: function regex_check_image($url="") { global $counter; ... Where do you initialize the $counter variable?
  5. Sorry, I meant var_dump($feedArray[$i]) to see if there is anything there.
  6. I don't see where you are initializing $counter. If it is outside the function, then this code won't work, since this variable inside the function will have its own scope within the function. Try adding: global $counter; at the top of your function to see if that works. But it will only work if you are declaring $counter outside your function (and outside any other functions).
  7. Sorry, I think I screwed up. This script will protect a file, not a folder.
  8. The command exit; terminates the script. You are incrementing the variable, echoing the variable to the screen, then stopping the whole script. It looks like you need to get rid of all your exit; commands.
  9. Create a PHP file inside the protected folder and use some logic in there. Assuming your protected folder had a username and password set up for the client, you can use this kind of code: <?php define("ADMINUSER", "username"); // whatever the user name is define("ADMINPASS", "password"); //whatever your password is auth(); function auth() { $PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW']; if ( ( !isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW )) || ( $PHP_AUTH_USER != ADMINUSER ) || ( $PHP_AUTH_PW != ADMINPASS ) ) { header( 'WWW-Authenticate: Basic realm="My Realm"' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required.'; exit; } } >? This doesn't include any of the other logic you need, but it should give you a good start.
  10. I've never known an echo to display an array like that. Try using a var_dump($winfo) on your array instead of an echo and see if it outputs the array correctly. Post the output here for us all to see.
  11. There's a typo in your select statement: MembershipFied should probably be MembershipField. It also looks like you may be using your sub-selects wrong (inside the parenthesis). This type of sub-select will take whatever is output from the SELECT statement and put it in there where the sub-select is located. So, for example, let me make up some cells for your tbl2 and tbl3 (i don't know what's actually in those tables). MySQL will first run what's inside the parenthesis and leave you with a SELECT statement that looks something like this: SELECT field1,field2,field5,MembershipField from tbl1, 3,2,1, 5,4,3,2, WHERE MembershipFied=$membership_type This type of SELECT statement doesn't make any sense. Could you explain in more detail what you want to accomplish with your database?
  12. Try doing a var_dump($feedArray) right before that line to see if there is an actual value for 'feedback'.
  13. You should probably post this into the MySQL help section.
  14. You're missing some semicolons after you initialize $catid and $catname;
  15. If you have a __Call function inside your class definition, this will handle any calls to undefined functions. Also, if your class is inheriting from a parent class, then the parent class may have that function defined.
  16. JOINS need to be in the FROM section, not the WHERE section.
  17. You don't have single quotes around your last account number variable like you do in the first part.
×
×
  • 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.