Copy link to clipboard
Copied
Does anyone know the way to fix the following errors whic are listed in the Safari /Inspect Element/Console:
[Error] Not allowed to load local resource: file:///MacBook%20Pro%20HD/Users/ann/Desktop/Web%20Sites/Shelbourne-America/phpmailer-contact-form/form.css (formpage-customised.html, line 11)
[Error] Not allowed to load local resource: file:///MacBook%20Pro%20HD/Users/ann/Desktop/Web%20Sites/Shelbourne-America/phpmailer-contact-form/form.js
[Error] Not allowed to load local resource: file:///MacBook%20Pro%20HD/Users/ann/Desktop/Web%20Sites/Shelbourne-America/Enable%20Submit%20Button...
My ISP tells me that i ned to fix these erors from my end but I don't know how to do that!
No browser can find it because it's pointing to FILE:/// on your MacBook. Until your resolve that manually in your code, it won't work from any server.
To save time, you could change the path to an absolute URL.
https : // domain / folder / filename/
Copy link to clipboard
Copied
Sorry for the appalling typos in my previous message! I tried to edit but the Edit button doesn't work
Copy link to clipboard
Copied
first question... if you use Dreamweaver, have you created a site, or at least defined a site from Dreamweaver ?
These errors occur because the file paths shown are files using local sources on the computer. They cannot be loaded by browsers for security reasons, most of the time because they are called by a script.
Use a relative path either to the document or to the root of the site.
if you don't understand what I'm saying, don't hesitate to say so, I'll try to be more clear 😉
Copy link to clipboard
Copied
Birnou:
Thank you so much for your very quick reponse.
Yes, I do work within a DW-Site and I thought that the scripts were all safely contained within the Site folder.
I uploaded the complete Site folder manually to my ISP using Filezilla.
The strange thing is that the PHPMailer Contact Form was working perfectly but just stopped working?
This what my Site Folder contains:
I don't know how to "Use a relative path either to the document or to the root of the site." so I would love to know how to do that!
Copy link to clipboard
Copied
instead of using such a path
I suppose that your web site is located in the folder Shelbourne-America, so
if you want to define a path relative to the web site, it means relative to the root of the folder where your web site is contained... you use a slash to start the path... so the path will
/phpmailer-contact-form/form.css
now if you want to use a path relative to the document... the starting point wont be the web site root folder, but the document that call (or include) the related file... but this time the path doesn't start at all by a slash. so in the previous exemple, if the hosting file is located at the root folder (sibling of the phpmailer-contact-form, the new path will be
phpmailer-contact-form/form.css
same as the previous one but without the starting slash
does this makes sense for you ?
by the way I see in the current path you use, that you use spaces... space are represented by the %20 string ... it is completly not permited in safe web... so use a - or a _ but not a space
see... you have thre %20
anyway if you define corretly the web site in dreamweaver and use relative path (document or website, whatever) those %20 will not appear, because your path will be resume to
/phpmailer-contact-form/form.css
or to
phpmailer-contact-form/form.css
and there is now spaces in those ones...
Copy link to clipboard
Copied
The phpmail-contact-form folder appears to be in your Taumel folder whilst you're trying to access it from your Shelbourne-America folder and presumably you dont have a phpmail-contact-form folder in your Shelbourne folder, or do you???
EDITED
OR are you now trying to duplicate what you got working the other day in another website folder, in which case, you have the links to the files mixed up because if you are testing the form in your Taumel folder then you should not be getting links which reference the Shelbourne-America folder files
Copy link to clipboard
Copied
Exactly the same thought had occuured to me and I added the PHPmailer folder to my over-all folder in the /public folder a short while ago.
I will go back to iPower and test to see if that works.
Copy link to clipboard
Copied
You're not working within a defined local site folder as evidenced by the FILE:/// paths pointing to resrouces on a local MacBook computer. Once your site is properly defined, the file paths should resolve to site assets within your local site folder, not your computer HD.
Copy link to clipboard
Copied
Nancy;
I did think that I had set up my DW Site correctly but it seems not?!
This is what I am seeing in DW:
The image is very small but the line (which may be the one that counts?) seems to lead back to my MBP?
:
Copy link to clipboard
Copied
When you save a file, paths to asset files should resolve to the correct ones in your site folder. DW gets confused by code errors though and may not resolve corerctly if there are errors in your code.
Failing that, remove the old asset and reinsert it. Save document (Cmd + S).
Copy link to clipboard
Copied
those links can be helpfull and more clear, than my previous frenchglish..
https://stackoverflow.com/questions/2005079/absolute-vs-relative-urls
or/and
https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL
Copy link to clipboard
Copied
To get rid of the spaces, I would have to rename all of my folders and the name of the MacBook Pro?!
That is quite some undertaking?!
Can I install the websites at System-level on a Mac in-order to by-pass the file-renaming problem?
Copy link to clipboard
Copied
What works on your local Mac won't work on Linux/Apache web servers. On the web, spaces in folder & filenames are converted to HTML entities %20 by browsers.
However, HTML5 doesn't allow spaces in filenames and using them will result in code errors. You may replace spaces with _underscores or hyphens-, but no special characters (&^%$+~) which have a special purpose on web servers.
Copy link to clipboard
Copied
To get rid of the spaces, I would have to rename all of my folders and the name of the MacBook Pro?!
By @AnnShelbourne
Nope as I told you... just use this convention from the main folder where you will place all your web site... then each child of this main folder will be your different web sites... and so local server, will serv from there...
so, from your main web sites folder, never use spaces, nor special char... just a to z , A to Z and - or _
main_web_sites_folder
- first_website
- other_web_site_folder_for_an_othe_project
- sample_project
and so on
Copy link to clipboard
Copied
Thank you all so much.
I will try again to get this working by reorganizing my file and folder naming and following your suggestions.
Do I in fact now have my Site configured correctly as a proper Dreamweaver Site (apart from the naming-spaces issues)?
Copy link to clipboard
Copied
The issue here does not appear to be your DW site definition, but rather the files you are trying to include are outside of that definition. DW is intended to work with your entire site within the site folder that you are working in. In your later screenshot you are in a site called "Taumel" but in your initial post your path is "Shelbourne-America". In looking at your site screenshots your Shelbourne folder is not within your Taumel folder, thus you end up with file:/// paths which are invalid online. Those files you need for Taumel should be in the Taumel site. If this were a remote server, it would be like hosting a video from Youtube. So your path would not be relative to your site, but an absolute reference to that other domain. I don't think that is what you are trying to go for. If this is just a script you want to use on multiple sites, just copy the folder from the one folder on your HDD to the other so that it is in both sites where you need it.
Copy link to clipboard
Copied
Ben:
Thank you.
I have just moved both my own web site (Shelbourne-America.net);
and also the site which I am building for clients (Taumel);
to new positions on my MBP.
Both Sites are now in the "users/ann/site" folder.
(I am temporarily hosting the new Taumel site within a registered sub.domain within my Shelbourne-America account at iPower.com).
I have already Filezillared the Taumel folder to iPower but my own website is huge so it is taking a while to upload across the internet.
Hopefully this will have got over the name-spaces issue although it was only the PHPmailer Contact Forms which were not working with my previous set up — everything else (in both the new Taumel site and the files in my own site) was working perfectly.
I will report back when the uploading is complete.
Copy link to clipboard
Copied
I have changed the positions on my HD of both my own site and the Taumel site so there are no gaps in the names once the folders are viewed on a Browser from my ISP’s hosting site.
If I was a visitor, to the Taumel site I would expect to be able to fill the Form and that it would then be emailed to the Contact when I hit Submit.
And that was working previously — but now it seems not to be?
In Safari, this is what I get from the Inspect Elements/Console when I am supposedly accessing the site across the Internet:
And Firefox cannot find “phpmailer-contact-form/form.js” although it is present.
The Form worked when I had it on my own site but things went wrong when I tried to access it through the
https://taumel.shelbourne-america.net
link.
I though that adding the required “event conversion” Google scripts to the end of the html files might have caused the problem so I removed them again but it hasn’t helped.
What can I try next?
Copy link to clipboard
Copied
Part of my problem may be that when I asked iPower for a Sub-domain (for testing the Taumel site) they apparently needed to set it up within separate a subfolder (among all the other subfolders in my account) in my public folder.
The Taumel folder does have its own Index which is accompanied by the other files in individual sub-sub folders for "Pages" "Images" etc.
I think that this arrangement is similar to what Birnou described?
Copy link to clipboard
Copied
As Nancy has stated, you will need to update that link to make it work, but moving forward if you select files DW should insert the correct path.
The setup you describe for additional domains is common for shared hosting where you are adding a second domain to that account. Because you do not have access above your own site, you cannot give that domain a test folder, even for testing. If you are just testing you really don't need to host it online. You could test locally on your own machine with a MAMP/WAMP or other similar setup to test the pages before they are published. If you eventually need to run more domains I would recommend moving up in hosting accounts to be able to separate your sites so they can be separate entities on the server and living inside one another, but that does get slightly more costly.
Copy link to clipboard
Copied
No browser can find it because it's pointing to FILE:/// on your MacBook. Until your resolve that manually in your code, it won't work from any server.
To save time, you could change the path to an absolute URL.
https : // domain / folder / filename/
Copy link to clipboard
Copied
Nancy:
Thank you hugely: your recipe worked perfectly!
I had had trouble trying to understand how to fix the issue with a Test Site piggy-backing on top of my own site.
(I will have to remeber to cadjust those new codings when I eventually hand the finished site over and we install it on their own site-hosting server.)
Ben:
You raised a very interesting point.
The piggy-backed sub-domain is a good work-around in this case because
I want the clients to be able to log-in at any time to test the Site as we go along.
I also need their technical input (in case my copy-writing wanders too far off-beam!); and also I welcome their comments concerning what images or services we add or remove or change.
This is a rather symbiotic project — which is a good thing.
🙂
Copy link to clipboard
Copied
I definitely understand the need for testing and desire to have that for clients and agree with you 100% on that. I was just stating that in shared hosting environments that you appear to be in, you are forced to have additional domains or sub-domains hosted within your primary domain. Subdomains are typically an A record that can be pointed anywhere. As you move into higher hosting plans with many providers you can get access to setup those subdomains in their own contained site roots that don't impact or live within your site root. So for instance:
Today:
/youraccountroot/public_html --> your root folder
/youraccountroot/public_html/subfolder --> your client's test site root folder
Proposed:
/yoursiteroot/public_html --> your root folder
/yourclientsroot/public_html --> your client's test site root folder
In this setup it also allows you to separate the sites in DW as the sites don't have to be within one another and can be completely separate in all respects. Hosts typically give you access with "reseller" or higher hosting packages where they offer a control panel that gives you access to this type of setup.
Copy link to clipboard
Copied
Ben:
Thank youfor your very clear description. Unshared hosting would obviously be a better soluion in the long-run but is probably a lot more expensive?! Certainly, its something to keep in mind.
For this site, the only problem that I have run into with shared-hosting has been the current one where my PHP form (and its supporting files) needed the special coding which Nancy suggested