some website-coding questions/issues

Santuzzo

Daemon Poster
Messages
675
Location
Amsterdam, The Netherlands
Hi,

I have been putting together my website by usage of a free template.
So far I have been able to change the template to my needs and - despite knowing close to nothing about HTML, CSS and PHP coding - I am quite pleased with the results I have gotten thus far by using google searches and reading online posts on coding, etc.

Now I have run into some questions and problems which I'd like to ask any of you who are knowledgeable about this stuff to help me if you can:

1. I have added some code in my .htaccess file to remove the file extension and I have tried to add a trailing slash. However, what happens is either the trailing slash does NOT work/appear, OR it does appear but then something weird happens when the site is on a smaller screen (mobile mode): the menu button on mobile mode does not work anymore, and when I hover over it I can see the link that shows in the bottom left of the browser ends on #menu while it ends on #navPanel when hover over without the trailing slash added.

2. is the trailing slash at the end a good idea anyway? I'm just wanting to have it there as I see many sites having it, so I don't really know if it bears any benefit other than aesthetics.

3. I have a php-contact form on my site which I set up in a way that it goes to an error page (which displays the form but also an error message on top of it) unless all required fields have a valid entry and an anti-spam checkbox is checked. all of this works well, however I would like to keep the entries someone has already enter when it goes to the error page, so that in case they just forgot to check the box they don't lose whichever info they have already entered. is there a way I can save the entries from the php form and have them re-entered in the contact form when the page displayed the error? can I somehow use a $name variable or something and have that appear in the name field on error mode?

I'd very much appreciate any help with any of this.

thanks,
Lars
 
Last edited:
1 & 2: not really necessary
3: sounds like you want to keep the form filled after validation?
https://stackoverflow.com/questions/33276966/php-keep-entered-values-after-validation-error

Also, just having a checkbox as an anti-spam measure won't do anything. You should use something like a Google reCAPTCHA as an actual anti-spam measure.

Thank you!

With regard to the missing trailing slash I think I found a problem:
I was trying to create a sub-directory on my website, but this did not work, probably due to the missing trailing slash, I assume?

Just in order to keep the html documents organized I figured it might be a good idea to have a directory for some HTML documents that fir into a category (in the case of my website: guitar licks).

Why won't the simple checkbox help against spam? Are spam-programs able to 'read' them and tick the box?
 
Thank you!

With regard to the missing trailing slash I think I found a problem:
I was trying to create a sub-directory on my website, but this did not work, probably due to the missing trailing slash, I assume?

Just in order to keep the html documents organized I figured it might be a good idea to have a directory for some HTML documents that fir into a category (in the case of my website: guitar licks).
Adding subdirectories with pages in them is fine. But having a trailing slash isn't necessary. Majority of people don't know what URL's are for websites anyway, other than the base "xxx.com". Other than that, they'll google search or use their browser favorites.

Why won't the simple checkbox help against spam? Are spam-programs able to 'read' them and tick the box?

Yup. It's just a form input field and a script/bot can be made to just tick the box. Similar to the "I agree to the terms..." that is just a checkbox. All of that can be automated.
 
Adding subdirectories with pages in them is fine. But having a trailing slash isn't necessary. Majority of people don't know what URL's are for websites anyway, other than the base "xxx.com". Other than that, they'll google search or use their browser favorites.



Yup. It's just a form input field and a script/bot can be made to just tick the box. Similar to the "I agree to the terms..." that is just a checkbox. All of that can be automated.

Thanks a lot for your help!
I will look into adding a reCaptcha in this case.

With regard to the sub-directory, I will have to fix some issues, because when I was trying to use a sub directory, linking on a button to a site within the sub-directory would not work (due to the removed extension and/or missing trailing slash in the URL) .... I will have to do some experimentation to see how to fix this issue. As of now I'm clueless .....

Another thing I read about on some of my google-searches was that having both versions of a site working (WITH and WITHOUT a trailing slash) might cause some disadvantages with regard to SEO. Is there an easy fix to solve this?
 
Back
Top Bottom