Jump to content

beer

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

beer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Muffins, thanks for the help. Nope, I don't have a variable SET Globally, in fact, I have put something $_SESSION["this_is_weird"] and echo $this_is_weird... then I still get the same value of the session! @thorpe - That is it! Thank you so much! I turned it OFF and it's gone.
  2. I have a question: If you do this: $first_name = "bart"; $_SESSION["first_name"] = $first_name; echo $_SESSION["first_name"]; You'll get bart, CORRECT? Now try this: $_SESSION["last_name"] = "simpson"; echo $last_name; What do you get? Yes, that's right: simpson Is this the normal behavior of SESSION? That is, just put a $ plus whatever's inside $_SESSION[""], and you get a variable that is EQUIVALENT to your SESSION? Try it for yourself! Please help me clarify this.... Thanks.
  3. Hi, I need some enlightenment with the commands urlencode($variable) and htmlentities($variable) Here's what I know. If you have this in your URL: Result: name: jason id: 23 What if the name of jason is actually jason& Or for example, it's a company? In other words, what we really need is the value jason& - we use URLENCODE Usage: urlencode($variable); So that jason& is the actual name (including the ampersand: &) Result: name: jason& id: 23 - success! But what if you have a form with 100 fields? Do you really need to use URLENCODE for all of these fields just so to include ASCII character values like % # * etc... in your url Do you use these in your forms? Similar situation with: HTMLENTITIES Reason? If the actual name of fred is <click me> or again if it's a company, what will appear in your browser or if you're editing a CMS website, is the name: <click me> - success! BUT if you DID NOT use HTMLENTITIES, Result: name: click me - the tags were striped, why? Reason: the browser thought that you have HTML TAGS so it processed it, therefore, we use HTMLENTITES to say to our browsers, "Hey you know those HTML TAGS < > I used inside click me? Well, they aren't really HTML TAGS so pls. include them." In effect, you won't get hacked in your website even if someone put a malicious code in your GET, POST or COOKIE, or Database like: <javascript>evilcode</javascript> simply because your browser won't follow the HTML TAGS and just show them, so now, does anyone use this function? If yes, what if you have 100 fields where this situation can come up, or if you're editing a CMS website, Do you REALLY need to put HTMLENTITIES to all of them, just to protect your site from being HACKED Or to be SAFE? That's all. Thanks for reading.
  4. Thank You! So I'll just have to put this in my classes table, right? One of the greatest lessons I've learned by using a Content-Mangement-System. You should create a functions.php and these functions are essential: 1. A function that GETS ALL ROWS in table 1. 2. A function that FINDS 1 ROW in table 1. (do this by mysql_fetch_array) 3. A function that GETS ALL ROWS in table 2. 4. A function that FINDS 1 ROW in table 2. (do this by mysql_fetch_array) Repeat as necessary. Then use While-Loops to retrieve data as necessary.
  5. Hi, can you pls. help me with my relational database? I have 2 tables that are linked together: So I did this: Here's the result: Did you notice that NUMBERS are displayed as the Student's Names with student_id so you don't know them? I want to diplay their Full Name so: Finally, here's the output, no problems so far... (I didn't include html in the example codes to make them simple) BUT.... Did you notice that the Full Names, are not in alphabetical order? Bottom line: How can I display the students LAST NAME in alphabetical order in the classes table If what's linking them from the Students Table are numbers or id's?
  6. Oh I got it finally!!! Thank you: xylex, Maq, and Daniel0 for your help. My problem has been solved. Thank you phpfreaks!
  7. Hey man thanks for that link, but I didn't understand what you meant in that article. Are you saying that I shouldn't use Many-to-Many relationships? If not, how do you exactly design a many-to-many relationship database? Appreciate your help kind man.
  8. Ok, I'm going to scrap off the CATEGORIES_ID (the relational field of the Table: toys to the Table: Categories). So I will make a NEW TABLE named: toys->categories ? Can you suggest a better name for the table? Thanks a lot.
  9. Hi, I have a database design question, My tables: toys models categories TOYS for sale: people, cars, boats, guns, and airplanes. MODELS under these TOYS: people -> US marine, He-Man action-figure, etc... cars -> F1 car, 1960 Ferrari, Tricycle War Vehicle, etc... boats -> Spyder89 Racing Boat, Destroyer, Batman's Boat, etc... guns -> Pistol, Bazooka, etc... airplanes -> F16, Cessna, No-Engine Sports Glider, Blimp, etc... CATEGORIES: Military Toys Sports Toys Cartoon Network Toys If a visitor ONLY wants to see Military toys, he/she can click: Category: MILITARY TOYS. My code: SELECT * FROM toys WHERE category_id = $_GET['cat'] = 1 (Military has id=1) But these same toys also BELONG to SPORTS toys. (category = 2) So I can't SUMMON these TOYS anymore because their field is ALREADY POPULATED with a CATEGORY_ID = 1 (Military), meaning, their relationship is with the MILITARY CATEGORY already. What can I do in my design so that these toys also show up under the SPORTS TOYS category? I've seen it done in BIG webpages, I just don't know how they did it. HELP!
×
×
  • 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.