IIS, PHP, JavaScript, CSS - javascript

I working on a new deployment for a Website. this websites runs since 2012.
the server getting changed to newer once.
so I installed IIS over the Server Manager Role. I Use PHP 5.2.
When I open the Site on the Server it showes me the Website but without any JS, CSS or even a button doesn't work. looks like the server doesn't includ some css files or isn't able to load JS. Only reads HTML.
In the Handlermapping I saw that .php, .html, .js or even .css is enabled.
so what im doing wrong that this website doesnt work? witch kind of information do you need to support me.
Additianal infos:
- I checked the path and its correct.
- If I change the index.php to index.html the css would be loadet but not everything.
- JS still dont work.
- I was also testing when the application is in a diffrent directory same result than wehn I change to index.hmtl.
- In the index.php file I use 3 times JS and the first line JS get called it tells me on the line xx Object expected.
dank you for hellping me

Related

Open HTML with CSS in JupyterLab tab with full formatting

I create an HTML document using Sphinx. When I click on the index.html file it opens a browser and looks like this. The look depends on some .CSS and .JS files being executed:
If I open the same file from the JupyterLab file browser, it opens in a tab but looks much worse: .CSS and .JS are not displayed, and images are not displayed. It looks like this:
Is there a way to get JupyterLab to get JupyterLab to execute the .CSS and .JS and pass through any images linked in the text? The JupyterLab is running on a remote server, so I don't have the option of having it create a new browser process on my local machine, because the files are remote.
Using JupyterLab within JupyterHub (old school install with conda, no docker and such)
I've been stuck at this HTML Preview issue for a few weeks.
I have the very same use case as you (Sphinx stuff for a team to work on their docs).
So far, no luck.
It may or may not work (depending on... I'm not sure of...) if I'm using JupyterLab from the browser on the hypervisor hosting JupyterHub itself
It won't work if I'm using JupyterLab from the browser on my client machine.
I tried to mess around with
c.NotebookApp.allow_remote_access = True parameter with no luck
tried to put it in my profile ~/.jupyter/jupyter_notebook_config.py
tried to add it to general config file /path/to/conf/jupyterhub_config.py
=> Not sure of the right way to set this option on JupyterLab's JupyterHub install, nor if it's even a relevant option...
Well, security wise, it's not, that's a given (^^'), but Preview HTML is an important feature for Sphinx users, hope someone can help with this...
I also looked after nginx config, but you get the issue with or without the reverse proxy anyway...

Website does not run properly through index.html

I have created a website with HTML, CSS and java script via Visual Studio code and as usual I have seen all changes via live server.
Through live server you can see everything properly and run everything well but if you click directly in folder on index.html then you get almost nothing. pics links and etc, not will run.
does anyone know why it is like this?
(I would like the site to be fully executable offline).
Run via VS Code Live Server
Run direct via index.html
It could be that you are linking them wrong. ../Img/Logo.png could be a wrong directory, although it is impossible to tell without showing your directory structure

png files failing to load when opening html file directly, but they load when opening from webstorm

I've been working on a game in javascript for my CS course. When I open the document by hitting run in Webstorm, it loads the game correctly, however when I just try opening the html file from Finder, the webpage opens but none of the png files I'm using for the sprites load. I opened Inspect Element in google chrome, and the javascript files loaded correctly but all the png files listed as canceled. This doesnt happen when the game is run from webstorm (when I run it from webstorm, all image files load properly).
When the game is opened directly from an html file (that's when I have the problem), chrome lists the path of the html document as the webaddress, although when opened from webstorm, it lists http://localhost:63342/CS%20Week%2010/CS105_Jessica.Davis_DogGame.html?_ijt=tmrr2fndgac82h07hlvt101gi4
How can I get around this issue so that when opening the html file from Finder it loads everything correctly? All image files are in the same directory as the html file.
Because of browsers security, loading files like this might not work from a url starting with file://
What webstorm is probably is making a local web server so that instead of saying file:// you could say http://. if any website was able to load images from file:// then any webpage you visit would have been able to search for any file on your computer and send it over the internet without your consent so browser often have these settings on. So you'd need a server. If you are working on your computer, you could make a local server just like webstorm and host your own files there. or host it on another service like github pages or codepen.
Now since all images are in the same directory, make sure that every time you call loadImage you use the images name and extension instead of saying /User/user/whatever_other_directory_you_have_it_under/image.png.
Once you did that you can make a local web server for the project. To make a local server, open Terminal (an application under utilities, you could spotlight search for it as well) and type cd, drag your project folder and drop it over terminal, and hit enter. Then type python -m SimpleHTTPServer and wait till it says something like Serving HTTP on 0.0.0.0 port 8000 .... Then taking the 0.0.0.0 and the 8000 you see in the example (yours may or may not be the same) go to your browser and type http://0.0.0.0:8000 (replacing the digits with whatever you got, not this link doesn't work until you do that)
Images should load alright. If you need to stop the server you can go back to terminal and hit control+C.
Note that when presenting your p5 sketch, no one else would be able to see the website on their computers if you make your local server. The local server is secluded to the device that is running it (although if their making their own local server and have your project files it should work just fine).
If you want the website hosted so that you could share a link with anybody in the world you could use codepen or github pages. If you go to codepen.io it should be self-explanatory although you'd have to upload your images to some image hosting site like tumblr or something and add the URL source of those images to codepen or you could put everything into github for even better results!
To use github pages you'd need to make a github account (preferably with your username being whatever you want your page to be named). Make a repository named insert_username_here.github.io. add your files to the repository (make sure to try to keep all sub directories and folder exactly as they are from your project folder). After a minute or two go to http://insert_username_here.github.io to admire your brand new hosted webpage!

Website, can't read php as code?

I have developed an website, and I was using just HTML, JS and CSS codes.
The pages are created like www.example.com/Home, it means no format...
My website was running well before i put this single line php code in it:
<?php include 'PageLoader_ST.php' ?>
Here is the code in screenshoot:
And here is the code read by Browser:
I am a little confused on how can i make it work? I don't wan't to use this format Home.php, is it possible anyway?
A file that should be parsed as php code, must have the file extension .php. There is no way around this.
The url and the real file name on disk must not be the same. Very often (and when you use a framework, almost always) they do not correspond. This is achieved through url rewriting. With an Apache server this is done with a .htaccess file.
You could use it to remove the .php extension.
In order to use PHP two things must happen.
1.) PHP must be installed on your server (I'm assuming apache), you can do this by either installing a windows lamp package (like xampp or wamp. installing standalone on a windows server is kinda tricky) Or if you're using a linux environment you can install PHP along with apache by installing the relevant packages.
2.) Your files must have a .php extension in order to tell the php engine that the file contains php script and it must be run through the engine to parse the scripting.
This is a design element in PHP and it is intentional.
EDIT: after reading your question again it looks like you're trying to have your homepage be mydomain.com/Home instead of mydomain.com/home.php.
Having a file that doesn't have an extension is not how you do that. Your file needs .php, and when you want to display the home page you need to use Apache rewrite rules in order for you to have the "pretty urls" affect for SEO and readability.
You can get around the .php from being visible if you use a folder structure along with 'index.php' files. Apache will look for a default file called index in each directory and use that before any others. For example if folder Home contains a file called index.php, you can still use the URL www.example.com/home/ and your site will still work.
This method will also work with a file named index.html or others.
NOTE: The Home directory can still contain other files that can be linked to but they must be linked to using the URL www.example.com/home/filename.extension

ASP pages not bringing in Images, CSS or JavaScript

My uncle's has got the files for his website that he got made a few years ago and needs something changed on it. So he has sent me the files as I am willing to make small changes as I know HTML and CSS. But when I open his index.asp page in a browser this only shows html even though the images, css and javascript files are linked properly.
I am not familiar with asp, I would really appreciate it if someone could let me know why the files are not being brought up when I open the index.asp file in a browser.
Thanks
Because when you just open the asp file on a browser, there's no web server intervention so that the ASP page is properly processed. You are just opening a file as if you were opening it on Notepad. You need to configure the whole site as an IIS Application and browse to the site by going to http://localhost/YourSite
First things first - as the previous comment says, you need to run ASP through an IIS based web site because the code needs to be processed.
If you're running through IIS and having this issue, check to see that your IIS settings are correct. Google "static content IIS" and you should find articles relating to this problem.

Categories

Resources