<?php include Stopped Working (It used to work fine) - php

Go figure.
A single php Include worked for several years on my site. Now it suddenly stopped.
\\
<?php include('ps_navigator_SOLO_AN_2016_Canvas.html');?>
\\
A link to the HTML page (FYI: HTML page is in a subfolder), that contains the above php, suddenly stopped working. Browsers, instead, tried to Download the page.
An .htaccess file was updated (apparently) by BlueHost (Apache) recently. I reverted to the previous one that worked.
Now, the link to the HTML page works again, but the php Include on that HTML page doesn't.
The Canvas file that is no longer included in the HTML works in the folder on its own. So it appears to still be in working order.
The HTML or the div has not changed since the time when it worked.
A PHP Test file works in these folders.
BlueHost Tech Support has told me "Not our problem."
I'd love to hear some ideas on this.
Thanks

Related

PHP Page is Attempting to Download Instead of Display Content

Problem: I'm creating a website right now, it's my first time dealing with PHP after learning the basics. My index.php file, when viewed on my localhost, is attempting to download the file and bring up the file explorer prompt. Does this on both Chrome and Edge.
Troubleshooting:
I removed the file association.
Tried on Edge browser.
Looked online for answers. All other YouTube videos & forums I found including StackOverflow had previous questions about this but the answers were either outdated by like 10+ years or just didn't for me.
What do I do? Any help is appreciated, and reminder I'm new to PHP so please no super veteran-sized solutions, thanks.
Edit 01: I was told to share my URL so here it is:http://127.0.0.1:5500/index.php
Edit 02 (Solution): I didn't realize that the Live Server plugin for VSC was only for static HTML pages and not PHP pages. WebPajooh helped me with setup how to achieve a similar result using XAMPP.
It was better to share your URL. I guess you are trying to access the PHP files by entering the file path, not the URL.
https://localhost/some_directory/some_file.php
If you are doing this, not entering the file path directly, check your web server configurations.

PHP Liveserver, Visual Code, SASS can't work together

I'm quite new to coding in Visual Code, and been able to use LiveServer flawlessly with html.
But I decided to go with php for a project, so I made a server with XAMPP, downloaded chrome extension for Liveserver, but it doesn't work as it should:
If I add something (like a div) in e.g. index.php, Ctrl+S, the browser reloads, and shows the new div flawlessly.
On the other hand, if I change some styling, which I do through SASS (yes, "watching" is on"), LiveServer detects some change, reloads the page, but uses the same css as before. Checked with browser F12, it is DIFFERENT from the one saved in the original folder...
So basically no matter how I change css, browser doesn't reload the new one.
Can you help me to make it work?
Thank you!
Try to clear browser cache and check if there is some errors in the console (where you watching sass files)

My page displays if there is an image only

This is the weirdest problem I've never met on PHP (I use it since 10 years) and that's why I'm writing this message. PHP version is 7.2.
I think it's not important but i use CodeIgniter, my problem is before, in the first index.php. All works in local, but when I put my code on a server (which is a shared server unfortunately), the behavior is :
if, in the beginning of index.php, there is an image using data:image with base64, the page displays
if not, i have a blank page
I just can't understand. I noticed this when i added a phpinfo at the beginning, suddenly my page displayed because the logo of phpinfo uses this kind of picture.
I made many many many tests, and the only way to make it work is using a data:image base64 before (and by the way, just before I use "" to put it in display none and it still works...). Using a link for the image doesn't work.
I have no error, nowhere.
I just want to know if someone has an idea about what is happening here ?
Thank you so much ! (Sorry I'm not an english native person)
I think you are using windows machine for local development. And your server is Linux based...
Linux server is fully case sensitive. Please check folder,files name is correct or not..
If a folder is ../View/123.jpg
Then. The src="../VIEW/123.JPG" will work on windows machime. But error in linux server..

creating a registration and login page with php and mysql on apache server (raspbian jessie)

Hello and thanks in advance for the help. I am running a LAMP server on my raspberry pi and I need help creating a registration and login page using mysql database. All my php files have to be in the /var/www/html. I've been googling this for about a week and I have some questions.
Where do I save css files
Can I make a subdirectory in the html that will create a website (I have tried to do this already but when i navigate to the site it tells me the page isnt working)
How do I make it secure (this is for a personal project so it doesnt have to be extremely secure I just want to know some common security issues)
I tried to follow http://www.allphptricks.com/simple-user-registration-login-script-in-php-and-mysqli/ steps and it showed nothing but a blank page.
I am not asking someone to just write all the code for me, I want to learn and understand what I am doing wrong so if you could direct me to a better tutorial or explain it that would be great.
Thanks
First off make sure all of your CSS files paths are set correctly in the HTML files that you are trying to style. As long as the CSS files are included correctly then it should style your page. The final destination of the CSS files should not matter as long as you have the correct path set to the CSS file in the HTML file.
Linking a CSS file to an HTML file W3Schools
All I did was search "mysql php security best practices" I'm sure you can find more but here is what I found (the first link in my case) OWASP

file paths suddenly aren't working in html

So I am building a website for a client. I have the site in my htdocs folder within xampp as well as in a folder on my desktop.
I developed the home page a few days ago and everything has been working fine on it. I have a css file in a css folder, and I have images in an images folder. My file paths are correct, I know for a fact because I have spent the last 30 minutes checking them. My tag is set up correctly, and my images names are correct.
I have validated my html and css and both are 100% correct. I know with out a doubt that everything is as it should be. All I did was add a media query to the bottom of my css document, refresh the page to check it, and all of the styles and images are gone.
I have removed the media query, I have check back up of the file that should work like it did yesterday, and I have crawled up and down my code. For some reason neither the desktop or the xampp version of the page are working. I have exhausted all resources in understanding why this is happening. I thought it might be my computer but every pages I have been to is working fine so it has to be something in my files, only I have checked everything I can think of.
Has anyone had this problem, and can anyone think of something that I might have missed?
After deleting my meta tags (out of desperation, I don't know how I would have reached this conclusion) the file started working again.
I had copied the meta tags from another site I built to save myself some time. I went through each one to see who was causing the issue, and it turns out that this:
<base href="http://designsbygabe.com/" />
is the issue. I'm not sure how relevant this tag is. CMS made simple auto generated it on the site I copied it from.
I can only assume that because I am running off of xampp but telling my document that The above href is the base that it confused the browser. I don't really know though.
the weird thing is that I added these yesterday and the site work up until a few hours ago.
I guess the lesson here is that when in doubt you should check your meta tags.

Categories