Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8711823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:58:47+00:00 2026-06-13T04:58:47+00:00

I am extremely knew to working with databases and servers and just downloaded MAMP.

  • 0

I am extremely knew to working with databases and servers and just downloaded MAMP. I have a website I made in html and css and want to inject a php script to it. I have saved the file in .php and when I navigate to it from the localhost port on my browser, none of the html is displayed. It only shows a blank white page. There is probably a really obvious answer but I’ve been searching google for an hour and haven’t found a solution.

This is the php script. It is wrapped in a

tag everything else in the document is html.

<?PHP
                        $filelocation = "Text.txt";
                        if (!file_exists($filelocation)) {
                        echo "Couldn't find datafile, please contact the administrator.";
                        }
                        else {
                        $newfile = fopen($filelocation,"r");
                        $content = fread($newfile, filesize($filelocation));
                        fclose($newfile);
                        }
                        $content = stripslashes($content):
                        $content = htmlentities($content):
                        $content = nl2br($content);
                        echo $content;
                        ?> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:58:49+00:00Added an answer on June 13, 2026 at 4:58 am

    Most likely there’s an error in your PHP code and it can’t be parsed. Check the server logs to see what the error message is.

    That seems to be valid PHP at a glance.

    You could read the file more easily by doing…

    $content = file_get_contents($filelocation);
    

    but that’s incidental.

    Turn on Error reporting in your php.ini file and then restart your webserver. This should give more detailed error information. You should also check your server error logs as there’s usually something in there too.

    Are you getting an HTTP 500 response code with the blank page? Also, are you sure the file in question actually has any contents?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Extremely just-started-yesterday new to F#. What I want: To write code that parses the
I am extremely new to json and have been working on this issue for
I'm extremely new to CSS--I'm talking I just started learning it yesterday. Anyways, I
I have some extremely poorly formatted HTML code, where each element in a table
Getting extremely confused with an adminhtml module i'm trying to write! Effectively I have
I have an extremely simple page that I'm trying to view in the Facebook
This is extremely strange, and I'm hoping someone will have some insights to make
I am extremely new for iPhone and SQLite. I have 1 button and three
I have an extremely large db table (around 30GB data file), and I started
Extremely new to Java an just playing around with it. I'm trying to add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.