Jump to content

Ingolme

Moderator
  • Content Count

    13,721
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by Ingolme

  1. Ingolme

    Simple question about iframes

    You cannot make the iframe's height match its content with CSS. You will need Javascript to measure the height of the content and set the frame's height. This only works if both pages belong to the same domain.
  2. Ingolme

    Simple question about iframes

    The content of the page in the iframe is inside a wrapper with a white background, while the document itself does not have a set background color. Because of that, the white ends where the content does.
  3. Ingolme

    Div areas not lining up as I expected

    It's not clear what the issue is. Is this image the way you want it to look or are you highlighting what's wrong? What code are you using?
  4. Ingolme

    Notice: Undefined offset: 1

    I don't know what the full requirements of your software are, but your code should look something like this: $type2 = 'Some default value'; $type_link = 'Another default value'; if(isset($typeChunks[0]) { $type2 = $typeChunks[0]; } if(isset($typeChunks[1]) { $type_link = $typeChunks[1]; } I'm also not sure why you've wrapped brackets around every single statement, they're not needed. There are also inconsistencies in your variable naming, you should either use all underscores ($type_link, $type_chunks) or all camel case ($typeLink, $typeChunks).
  5. Ingolme

    Notice: Undefined offset: 1

    The $total_type string does not have a "|" character in it. Any time you're dealing with an array of unknown length, you should use isset() to determine if an element exists before using it.
  6. It's an issue with invalid HTML. Pass your code through the validator and fix all the errors it shows: https://validator.w3.org/ Tags should be closed in the opposite order they were opened. If you opened with <b><u> then you have to close with </u></b>, not with </b></u>. Here's a list of some of the errors on your page: <!DOCTYPE! html> should be <!DOCTYPE html> The <title> tag does not have a style attribute. The <u> tag is deprecated and should not be used. You can use CSS to replace it. Tags are not closed in the right order. <marquee> is deprecated and should not be used anymore. You can use CSS animations to replace it. Here's a list of things that aren't technically errors, but you should do to follow best practices: Avoid the use of style attributes, put all of your CSS in the stylesheet. Avoid the use of <b> and <i> tags to style blocks of text. Use CSS to change the style. <br> does not need a closing tag, you can remove the </br>.
  7. Ingolme

    Height not working.

    You shouldn't use a table. Just set min-height rather than height. This solution won't work for tables.
  8. Probably due to an unclosed <a> tag, but you'll have to show your code for me to be sure.
  9. Ingolme

    Desperately need to upgrade website security

    HTTPS is not necessary for the main site since there is no sensitive information passed to or from it, but I do agree that the forum should be encrypted.
  10. Ingolme

    what if user disabled javascipts ?

    Yes, you should always have server-side validation and I would highly recommend having your form work properly without AJAX before adding AJAX functionality.
  11. Ingolme

    CMS, start with one or add later?

    No, themes and templates are simply the part of the software that determines how the data will appear visually on your site. If you're good at it, you can build a drag and drop editor into your theme, it varies depending on which CMS you use. As an example, Wordpress has a lot of documentation on how to build themes for it and there's a lot of code involved. Not just HTML and CSS, but also PHP. https://codex.wordpress.org/Theme_Development
  12. Ingolme

    CMS, start with one or add later?

    There's no easy way to just add a CMS to your existing site. You have to build the front end again using the theme and template system provided by the CMS, so you'll be doing a lot of work either way. You may be able to keep some of your CSS, but the HTML will probably have to be created from scratch.
  13. Ingolme

    how to upload multiple image,preview image

    You'd start off with multiple <input type="file"> elements, you'd have some PHP code which gets the files from the $_FILES array and saves them into specific directories. You would then have some code to write the paths of the saved files into the database along with any other information about the image. On other pages of your site, you would have some code that pulls image information from the database and prints <img> tags with the saved paths. Here are the tutorials you should read to accomplish these tasks. Form Handling File Uploading Database Tutorial (12 pages) All this assumes you know the basics: variables, loops, functions. If you don't know the basics, just read the whole PHP tutorial from start to end.
  14. Ingolme

    php use and namespace class not found

    First, you need to include the file of the class you're going to use. The second thing is that you have to have a leading backslash to indicate that Base is in the global scope. <?php namespace Base2; require_once 'path/to/Section.php'; class Base2 extends \Base\Section { // ... } I am not sure why you are both extending a class and then instantiating the same class inside the extended object. You either do one or the other, not both. In this case, just delete the test() method from Base2 because it already has this method inherited.
  15. Ingolme

    JSON and object

    It's correct to wrap property names in quotes in Javascript. JSON stands for "JavaScript Object Notation", after all. If the JSON is in a string as when returned by AJAX, you need to use JSON.parse() to read it, but if you can just have the JSON right in the code itself, you won't need to parse it.
  16. Ingolme

    Option Tag - list items not sent to server

    That's because HTML attribute values have to be surrounded by quotation marks.
  17. The reason is that the keys haven't changed. You should use a foreach() loop where possible to iterate through arrays. I rarely ever use a for loop. If you would like to reassign the indices after the call to array_unique(), you can use array_values(). Then you can use a classic for() loop. $unique_even_numbers = array_values(array_unique($even_numbers));
  18. Ingolme

    AJAX script.

    If this is running in your local filesystem then your browser security settings may be preventing scripts from accessing the text file. It is best to test AJAX in a real server environment.
  19. Ingolme

    Unicode characters displayed incorrectly

    Perhaps your database connection code needs to be set to use UTF-8.
  20. Ingolme

    Text outside an upside-down trapezium

    The reason is that the top border always goes above the content while the bottom border goes below it. To do the upside-down trapezoid, it might be better to put the border on the ::before or ::after pseudo-element and position that inside its container behind the text.
  21. Ingolme

    Unable to horizontally center a card gallery

    Remove float: left from the gallery and add text-align: center. You're missing a semi-colon after width: 90%, so it's not being interpreted correctly.
  22. Ingolme

    Functions not executing - no error msgs

    All those backslashes are probably going to cause a problem. Other problems are that no code will run after a return statement and the browser will leave the page as soon as you assign a value to location.href. This button could easily be replace with a link and would not need any Javascript at all.
  23. Ingolme

    RSA encryption

    You will need to include a script file on your page to use it, but you might not need to host it on your own server if they are offering a CDN.
  24. Ingolme

    RSA encryption

    RSA is not a native Javascript object, you will have to find a library. Wherever you found that code should have some documentation telling you where to get the library.
  25. Have you tried the ended event?
×