- This topic is empty.
-
AuthorPosts
-
August 26, 2012 at 9:43 pm #108517
hrechkaness
MemberI get this text
Not Found
The requested URL /phpinfo.php was not found on this server.
August 26, 2012 at 9:43 pm #108518chrisburton
ParticipantIs that file located in htdocs?
August 26, 2012 at 9:46 pm #108519hrechkaness
MemberThe only thing I have located in my htdocs so far is index.php, stylesheet.css, header.php
August 26, 2012 at 9:46 pm #108520chrisburton
ParticipantMove phpinfo.php inside htdocs and see if that solves it
August 26, 2012 at 9:50 pm #108521hrechkaness
MemberDo I have to create a phpinfo.php file or is there an already existing one that came with MAMP?
August 26, 2012 at 10:01 pm #108522chrisburton
Participant@hrechkaness Follow this tutorial and reload Mamp. Then take a screenshot of the error.
August 26, 2012 at 10:08 pm #108524hrechkaness
MemberWill do, I’ll post back once I’ve finished the tutorial
August 27, 2012 at 9:49 pm #108573hrechkaness
MemberAlright, I finished the tutorial but it turns out, that wasn’t the answer to my problem. It was directly related to my header code. If I had listened to your advice in the beginning and changed it to the doc type to html5, I’m sure I wouldn’t be having this problem. Here is the code I had to delete to make my page run smoothly.
Thanks for all your help. I’ll post back if I’m having any other issues but it looks like it should be smooth sailing from here. Cheers!
August 28, 2012 at 12:21 am #108580chrisburton
ParticipantThe tutorial would have allowed us to see where the problem was, not immediately solve it. Glad it’s now working.
April 13, 2013 at 5:23 am #131686RaihanMazumder
MemberHow can I include header & footer if my content page is inside sub folder. Could you plz tell me what script i’ve to use if my pages inside folder / sub folder. so far i know and see here:
if my pages without folder.April 13, 2013 at 5:55 am #131690CrocoDillon
ParticipantYou can go inside subfolders with `include ‘subfolder/header.php’` or inside parent folder with `include ‘../header.php’`
July 9, 2013 at 11:41 am #142030arlenev1
Participanthrechkaness you’re the MAN. I have two more weeks before graduation in a Web MultiMedia Design class. I love it from UX to php. The instructors just touch on php the rest is on me.
Just reading your post and comments have got me where I wanted to be with the include tag.
ThanksAugust 3, 2014 at 9:42 am #177420rufncrus
ParticipantPHP code
< ?php include 'header.php'; ?>
and< ?php include 'footer.php'; ?>
in this post no longer works.Please update post to
<?php include('header.php'); ?>
and<?php include('footer.php'); ?>
“Cheers”
August 3, 2014 at 10:57 am #177424__
ParticipantPHP code
< ?php include 'header.php'; ?>
and< ?php include 'footer.php'; ?>
in this post no longer works.What do you mean by this? What are you trying to do, and what is the problem you are encountering? Please describe what you are trying to do, what actually happens, and any error messages.
Please update post to
<?php include('header.php'); ?>
and<?php include('footer.php'); ?>
include
(require
, et.al.) are language constructs, not functions. Placing parenthesis around the filename is not necessary, and, in fact, can be misleading.The only thing wrong, syntax-wise, with your example above was the space between the
<
and?php
. I don’t know if that is an actual typo in your code, or just how you wrote it here.<?php include 'header.php'; ?> <!-- HTML content --> <?php include 'footer.php'; ?>
October 30, 2015 at 2:52 pm #210366dvermeersch
ParticipantIf you call this piece of code in a HTML page that contains references to CSS and JS files, then I suppose you need to place all files in the same folder as header.PHP so that the server knows where to call the php scripts?
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.