Jump to content

Zane

Administrators
  • Content Count

    4,166
  • Joined

  • Last visited

  • Days Won

    10

Zane last won the day on October 24 2019

Zane had the most liked content!

Community Reputation

64 Excellent

About Zane

  • Rank
    Prolific Member
  • Birthday 08/19/1986

Recent Profile Visitors

18,855 profile views
  1. You provided a screenshot of your desired format: a button next to a button. However, you say that it kills the page. Do you have a way of showing us that? Even if I use Developer Tools to add a button with copy/paste, it doesn't break the page and there is a button next to a button with no issue. What part of the page is killed?
  2. https://www.php.net/manual/en/function.simplexml-load-file.php So using the syntax $path->name will not work and will throw such an error $simplexml_load_file returns one SimpleXMLElement But why even use xpath()? You could just do this. <?php $string = <<<XML <?xml version='1.0'?> <GoogleCodeBase> <result> <geometry> <location> <lat>LATITUDE</lat> <lng>LONGITUDE</lng> </location> </geometry> </result> <result>
  3. I completely agree with Barand. There is definitely a more efficient way of doing this, but it is your choice to keep doing it this way. You could at least set up a sandbox/staging version of your site and practice with different approaches, but that's just me saying things. In any case, we need more information: What does your table schema look like? What kind of output are your receiving? What do the arrays look like once you've looped through everything? Why aren't you just exploding on the comma? Step by step, what is going on here. Echo it all out and sh
  4. I would make students[modules] an array of module objects instead of an associative array with numbers in quotes. var data = { "students": [ { "name": "Eric Smith", "modules": [ { "id": "COMP40003", "name": "Software Development", "result": 80 }, { "id": "COMP40001", "name": "Digital technologies", "result": 71 }, { "id": "COMP40004",
  5. Perhaps you should re-phrase your question because, obviously, the solutions given to you aren't what you're looking for, as you've pointed out. If you're simply trying to increment the ticket id/number by one every time a ticket is added to the table, then the above solutions are what you need. From the code you provided, it almost looks as if you're trying to place the current count of tickets purchased at the time of the new ticket insertion. For instance, George buy 5 tickets and at that point in time there had already been 80 tickets sold, so you put 80 + 5 to put in that column.
  6. PHP has a handy function for this called: is_dir()
  7. OK, so that should involve: A users table, of course, that contains the height and age An attributes table, with a column for the name of the attribute and unit of measure (UOM i.e years). A user_attributes table with a column for user id, and attribute id, attribute's UOM value
  8. So, it sounds like what you're after is custom attributes User A has a hypnotism rate of 45 neurons per second, and a clairvoyance rating of 5 / 10. User B has a rank of 3 of understanding of quantum physics and a shoe size of 25 and a half meters. User C has fourteen years worth of towel folding experience User D can eat twenty three beer battered brauttwerst in 48 seconds. Am I getting closer to what you're talking about?
  9. First of all, PHP and HTML are two separate things altogether. PHP is typically used to generate HTML. No matter what language you use, when you load a page in a web browser it's source will be pure HTML (and/or even JavaScript). In PHP, the way to preserve a session on every page is to call this function before the first time that you use any $_SESSION variable or anything session related. session_start(); There's no "html page" or "php page". There is just a file that a browser reads the best it can depending how the server reads the extension of the file. So, in order to acc
  10. From what I understand so far, you're wanting to keep up with car parts, no? I'm not an auto expert or anything, I'm just trying to get a feel for what exactly you're aiming for here. Either you're trying to keep a record of engines, engine parts, and just auto parts in general, and you're wanting to be able to link certain parts to the cars/autos they're available/compatible with,... or, you're just keeping up with a list of cars and what motor(s) they have/had for e.g a car lot where car salesmen sell cars and keep up with the inventory. Or, perhaps, you're working on a use case catered t
  11. Cars contain a motor. Motors do not contain cars. Therefore, put a column for motor in the Cars table and link through the various motor ids.
  12. Yes! Especially since you're not wanting to use JavaScript, it's as simple as putting links to the same php file but with a query parameter for the category. If you'd use JavaScript, you could do some AJAX magic and just change a portion of the page to reflect the category clicked. That's a bit more involved, though.
  13. What? A bit impatient, aren't ya. First, you make a PHP script that grabs all products from a database where the category equals whatever is in the GET parameter in the URL http://mysite.com/products?cat=movies Then, you loop through the results and display them however you want. It's also possible that a product is part of multiple categories. In that case, you'd have a table just for categories, and then another table linking the columns to products, and then the products table. There's really no cut-and-dry answer here. You simply grab the category id or name
  14. There are a handful of those kinds of pages. Category Listing Page (CLP) Typically, this is more or less what you'd call a homepage for a particular category where you explain what it is, provide pictures of different products in that category, etc... Typically, the CLP might have a few featured products, but doesn't show them all. Then again, it's up to you. A lot of times you'll find videos on this page, or some kind of introduction to the category. Example: https://www.burpee.com/organics/ Product Listing Page (PLP) This is a page listing your products. It's
×
×
  • 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.