- - - - -

Total newbie question!


  • Please log in to reply
8 replies to this topic

#1 beat

beat

    Tiny Orange

  • Members
  • Pip
  • 4 posts

Posted 14 June 2011 - 10:33 AM

I'm very new to all this... Internet stuff ;) I simply can't get my website to work. I have the code to the first page in a document called index.php (it's just a placeholder and it works just fine when I open it with Firefox so there's nothing wrong with the code), but when I put it into the folder public_html on my cpanel nothing happens to my site, it's just all empty. If I look at the source on the page, everything is looking fine, so why isn't it displaying anything? What am I missing? I bet it's something really really easy but I just can't figure it out...

#2 davidatfuzzylime

davidatfuzzylime

    Designer; coder; geek

  • Members
  • PipPipPipPipPip
  • 425 posts

Posted 14 June 2011 - 11:27 AM

Hi,

If you give us a link, and post the contents of your index.php file, we can probably help.

As a guess, there's another index file in the same directory as your index.php - index.html or default.html - which is being displayed first (servers check through a list of possible "default" files and some of these are before index.php in the list). To verify if that's what's happening, you can go to www.mysite.com/index.php and see if your page loads.

Incidentally, if you don't have any PHP code then you can simply call your front page index.html - this will actually make it load slightly more quickly as the server won't look for any special code inside it!

Good luck :)
fuzzylime: we know design
Save money when you sign up! Go here then use code giveme15 to get 15% off or giveme5 to get $5 off your order.

#3 beat

beat

    Tiny Orange

  • Members
  • Pip
  • 4 posts

Posted 14 June 2011 - 01:35 PM

View Postdavidatfuzzylime, on 14 June 2011 - 11:27 AM, said:

Hi,

If you give us a link, and post the contents of your index.php file, we can probably help.

As a guess, there's another index file in the same directory as your index.php - index.html or default.html - which is being displayed first (servers check through a list of possible "default" files and some of these are before index.php in the list). To verify if that's what's happening, you can go to www.mysite.com/index.php and see if your page loads.

Incidentally, if you don't have any PHP code then you can simply call your front page index.html - this will actually make it load slightly more quickly as the server won't look for any special code inside it!

Good luck :)

That sounds reasnonable enough, but I'm not sure that's the problem either. I tried both .php and .html, none of them works. Here's the adress: http://www.1811.nu and the code looks like this:

Quote

<!DOCTYPE html>
<html lang="en">
   <head>
       <title>1811 ord&amp;bild</title>
       <meta charset="utf-8" />
       <link rel="stylesheet" href="http://yui.yahooapis.../reset-min.css" />
   </head>
   <body>
              
       <div style="width: 1000px; margin-left: auto; margin-right: auto; text-align: center;">

                       <img src="snart.jpg" />
               </div>
      
   </body>
</html>

And 1811.nu/index.php is just as empty as the main page :( There is only the one index.php-file in my public_html folder, and then the cgi directory, but that's supposed to be there, right? And I'm not supposed to put the index.php in the cgi-bin or anything like that?

Thanks for trying to help :)

Wait, should I be using a FTP client to upload my files? Is that necessary? I only used the "upload"-button in cPanels File Manager.

#4 davidatfuzzylime

davidatfuzzylime

    Designer; coder; geek

  • Members
  • PipPipPipPipPip
  • 425 posts

Posted 14 June 2011 - 01:44 PM

It looks like the page is there but you haven't uploaded the image? That's what I'm seeing - the title is right and there is an image tag there. Try uploading the image too!

cPanel is fine for smallscale uploads but it's definitely worth getting into FTP sooner rather than later - it's very easy to set up :)
fuzzylime: we know design
Save money when you sign up! Go here then use code giveme15 to get 15% off or giveme5 to get $5 off your order.

#5 beat

beat

    Tiny Orange

  • Members
  • Pip
  • 4 posts

Posted 14 June 2011 - 01:54 PM

OMG! I'm so stupid! My friend who did the code told me it's VERY IMPORTANT that the image file is in the same folder as the .php-file so I was very careful coordinating their names and location - on my harddrive! Haha, I can totally see the lack of logic in that thinking now... Everything works perfect now, thank you very much!  :)  :) I'll soon be back with even more unthinkable questions!  :D

#6 jednorozec

jednorozec

    Eclectical Engineer

  • Volunteer Moderators
  • PipPipPipPipPipPip
  • 1,120 posts

Posted 14 June 2011 - 02:48 PM

What you have is html not php so it's not necessary to call it index.php.
Join ASO and use a coupon to Save $5 or Save 15%

#7 davidatfuzzylime

davidatfuzzylime

    Designer; coder; geek

  • Members
  • PipPipPipPipPip
  • 425 posts

Posted 14 June 2011 - 03:36 PM

Yeah, jed is right - because you're not using any PHP code if you rename the file to index.html it will load faster and put less (practically no) strain on the server :)
fuzzylime: we know design
Save money when you sign up! Go here then use code giveme15 to get 15% off or giveme5 to get $5 off your order.

#8 beat

beat

    Tiny Orange

  • Members
  • Pip
  • 4 posts

Posted 15 June 2011 - 04:22 AM

I get the point, thanks, but if I know my coding friend right, there is PHP to come... :) I'll just leave it for now and try to get on with the rest of it. Thanks again for the help!

#9 NyteOwl

NyteOwl

    36 Bits forever!

  • Volunteer Moderators
  • PipPipPipPipPipPipPip
  • 1,902 posts

Posted 15 June 2011 - 02:00 PM

Just a couple of additional considerations.

You might also want to use a proper full DOCTYPE statement. That one will work after a fashion but will leave a while lot of things up to the discretion of the browser as to how they are going to display.

Pulling in your css file from another server may result in your site not displaying properly for the increasing number of people who filter out cross-site calls for security reasons. It also slows the display of your site as a call has to be made to a second server.

Just a thought.
Obsolescence is just a lack of imagination.

Sign up at ASO and enjoy friendly, quality hosting services. Use coupon code no2512 and save 15% or coupon code 2152on and take $5 off. Valid on both Shared Hosting and VPS plans.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users