Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
FaiL___

Trouble with websites

Recommended Posts

Posted · Original PosterOP

Hi, for the past 2 weeks I have been making a website. It's very basic, but it works and have just bought a domain and vps so that it can be hosted. PHP is installed on the server as well. I have uploaded the exact files that worked on my laptop using xampp and it doesn't work, none of the html that was echo'd inside the php is working, which is essentially my whole site. To test to see if the files were corrupted, I downloaded them off of filezilla and added them to my desktop. The code works fine there when using xampp too. Can someone please help me, cheers in advance.


There are 10 types of people in the world. Those that understand binary and those that don't.

Link to post
Share on other sites
Posted · Original PosterOP
Just now, myselfolli said:

Do you get any error messages?

No, none at all, there's a page first that requests for your location using an html form, which works fine as the majority of the page is in html, then it sends you to my main page, which just shows a black screen except for the background colour, which is correct. It looks like just the echo statement isn't working as the php in the location selector page works fine as that is what sets a cookie, which i can see being set.


There are 10 types of people in the world. Those that understand binary and those that don't.

Link to post
Share on other sites

Did you get the paths to your files correct? Maybe check your developer tab (depending on which browser you use) to see if your html document is actually being loaded?


75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites
Posted · Original PosterOP
2 minutes ago, myselfolli said:

Did you get the paths to your files correct? Maybe check your developer tab (depending on which browser you use) to see if your html document is actually being loaded?

So it looks like just the head of the document is loading in, which is why the background is correct, but everything in the body is not being shown.


There are 10 types of people in the world. Those that understand binary and those that don't.

Link to post
Share on other sites

Do you have a link for me to go see it for myself?

Also check the log


75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites
Posted · Original PosterOP
Just now, myselfolli said:

Do you have a link for me to go see it for myself?

Also check the log

morganwelch.co.uk/weather

 and i will check the log now

 


There are 10 types of people in the world. Those that understand binary and those that don't.

Link to post
Share on other sites
Posted · Original PosterOP
3 minutes ago, myselfolli said:

Do you have a link for me to go see it for myself?

Also check the log

I'm getting an Error 500: internal error when loading the php document.


There are 10 types of people in the world. Those that understand binary and those that don't.

Link to post
Share on other sites
3 minutes ago, FaiL___ said:

morganwelch.co.uk/weather

 and i will check the log now

 

Alright, so your index.php is returning an Error 500 (internal server error), that will most likely be your problem.

And on a side note:

 

 if(screen.width <= 699)
        {
            document.location = "mobile/mobileindex.php";
        }

I guess this is supposed to redirect me to a mobile version of the website, this is not recommended. Check out CSS media queries - they can do what you're looking to achieve, but in a more elegant way


75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites
2 minutes ago, FaiL___ said:

I'm getting an Error 500: internal error when loading the php document.

Do you have the code?


75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites
Posted · Original PosterOP
5 minutes ago, myselfolli said:

Do you have the code?

 

6 minutes ago, myselfolli said:

Alright, so your index.php is returning an Error 500 (internal server error), that will most likely be your problem.

And on a side note:

 


 if(screen.width <= 699)
        {
            document.location = "mobile/mobileindex.php";
        }

I guess this is supposed to redirect me to a mobile version of the website, this is not recommended. Check out CSS media queries - they can do what you're looking to achieve, but in a more elegant way

I do have the code: https://pastebin.com/2tcp0buv

 

and I know there's probably a better way of doing the mobile formatting, but I've done my code in an awkward way and am still working on it, so I will definitely look into that when I get round to updating that.

 

EDIT: Just excuse my horrible and messy code


There are 10 types of people in the world. Those that understand binary and those that don't.

Link to post
Share on other sites
52 minutes ago, FaiL___ said:

 

I do have the code: https://pastebin.com/2tcp0buv

 

and I know there's probably a better way of doing the mobile formatting, but I've done my code in an awkward way and am still working on it, so I will definitely look into that when I get round to updating that.

 

EDIT: Just excuse my horrible and messy code

Okay, a few notes on your code:

 

- There's no point in closing and then immediately after reopening your php tags

- Don't escape quotes, use ' and ", example:

echo '<a href="#">This is a link</a>';

instead of

echo '<a href=\'#\'>This is a link</a>'

 

 

I can't really see where your script is failing, the error code in your logs should have more information


75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×