Jump to content

bluejay002

Members
  • Posts

    452
  • Joined

  • Last visited

    Never

Everything posted by bluejay002

  1. Hey there, I was trying to find how does a cart item global variable is set but to no avail. I can't seem to find it since I need to know where the data are being pulled in. Is there anyone who knows where I can find this one and how I could possibly modify one, or at least duplicate into a different global variable? I have been around the admin, tried searching and looked up to their site's knowledge base, but all to no avail. Thanks a lot, Jay
  2. Well, you could since $_POST is superglobal but that defies the purpose of having a function and only makes it less reusable for any other variables that wish to use it.
  3. Generally, "public" is a visibility keyword that tells a variable/method is accessible not just within the class nor by its subclasses, but can also be referenced outside the class, once an object of the class has been instantiated. If some other class is going to use it, it could possibly because the class is a subclass of that parent class that has the public variable, an object of that class was instantiated within the class using it, or the object referencing to that class was passed as a parameter in a method of the class using it.
  4. You can also check this tutorial to give you more light with PHP functions. http://www.w3schools.com/php/php_functions.asp
  5. If you prefer not to have so many nesting loops, you can alternatively use SQL and use JOIN / UNION. Also, having so many database queries unnecessarily is also not good. Below are some topic links on both (or check google, there's plenty you can find there), please see which applies to you: JOIN: http://www.w3schools.com/sql/sql_join.asp UNION: http://www.mysqltutorial.org/sql-union-mysql.aspx
  6. Alternatively, you can do it this way: function first_and_last($first_name, $last_name) { return $first_name[0] . '. ' . $last_name[0] . '.'; } Cheers, Jay
  7. mmm... ok. About the news, you can forcefully do it one liner then just cut the string with a dot dot if the line is too long. or Make the first line as the title only then make the second line for the update date and cut the name first name with a dot dot to make it understandable. dot dot = ellipsis
  8. That's rather a great improvement, great work! On the recent update, some info are being overlapped by the Latest Photos from our shows. A fix on the display would be nice. Are they selling online? If so, placing "about us" on a separate page would be better and changing the homepage into something that when a visitor came upon your website, they will get a glimpse how great the products you are selling are. Just a suggestion but its all up to you. Really nice work there. bluejay,
  9. Oh, is that so? My reading must have been faulty, my bad, correction well taken. thanks a lot.
  10. Well, yeah, maybe so but PHP call both of them as functions, not as functions and methods. Hope this clears up.
  11. @Mr. Adam: The whole idea is the same since methods are functions are essentially the same if you look at it at the functions point of view. But it will be no if we look at it at the perspective of a method as a functions inside a class. Well, to make things easier for you, let's just settle to no, its not.
  12. A rather more precise answer in general terms. In PHP, functions inside a class is still called function but are somewhat different with the one declared outside so calling the functions inside a class as methods would make things easier to understand.
  13. Yes, in PHP, we call that functions. In Java, we call that methods but the whole idea is the same.
  14. You can do this in two ways: 1. Do this in your query. 2. Use a delayed printing of result by atleast 1 record and have the previous record stored in a temporary variable so that you can scan out what to do with it. My two cents. bluejay,
  15. First of... INSERT INTO, which is a query, is not the reason if it does not run on other browsers, SQL has no idea what browser you use and never will (I suppose). Better check first if all those values are being passed properly to your server from the client during that POST. Something must have gone wrong beforehand. bluejay,
  16. And as much as possible, avoid using "variable anywhere". If you have values that you want to be readily available and is quite usable in the whole series of lines of codes of files, use constants instead.
  17. I don't advise you do it that way because it beats the purpose the way function should be used. I even suggest to use Object-Oriented approach in doing so and avoid using "variable anywhere". My two cents. bluejay,
  18. who is $table? is it a variable inside the function? I suppose that $table is not initialized inside the function but rather outside the function. pass it as an argument to the function, receive it as a parameter $table inside the function declaration and it should work fine. bluejay, EDIT: oh okay... you already got it.
  19. @projectFear: well, its not entirely my code. I just assume his code were correct and added my code on it. I'm kinda lazy writing a new code over something that the user didn't complained about.
  20. try this: $ext_array("jpg", "png"); // so on and so forth $ext = substr($file_name, strrpos($file_name, '.') + 1); if(!in_array($ext, $ext_array)){ $exterror++; } if($exterror > 0){ echo "Error:File type not supported."; return; } hope this helps. bluejay,
  21. I am not sure if this will work as I haven't tested this but you may want to give this a try: $connector = ";"; // choose what would be convenient for you $insertlike = "UPDATE status SET likes=CONCAT(likes, '$connector','$username') WHERE statusid='$statusid'"; Just give it a try and reply back if it is still not working. bluejay,
  22. I suppose so.
  23. If you are to compare a date with the current date, do this: $currentTime = mktime(); $userTime = strtotime(place_here_valid_date_time_from_variable); // replace that value if(($currentTime - $userTime) >= 120) { // do whatever you like } Hope this helps. bluejay,
  24. good for you.
×
×
  • 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.