Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

My PHP include won't work

Featured Replies

Hey, my php include won't work. I haven't uploaded it to a server yet, so I'll have to paste all the code here.

 

index.php

<html>

<head>
<title>site title here</title>
<LINK rel=StyleSheet href="css.css" type="text/css" media=screen>
</head>

<body>

<div id="container" align="center">
<div id="header">
<a href="index.php"><img src="images/logo.png"></a>
</div>
<div id="menu" align="right">

</div>

</div>
</body>

<html>

 

menu.php

<a href="index.php">Home</a> <a href="index.php">Services</a> <a href="index.php">Portfolio</a> <a href="index.php">Contact</a>

 

Am I doing something wrong?

 

Regards

then its a path problem, the file is not in the same place as the file your include menu into :)

 

for future... don't delete code unless its passwords, makes it harder to help :)

<?php include("name.php"); ?>

 

This is the basic php include code and just as an addition if the file is located 1 file under you do ../ is it 2 files more under then it's ../../

else file up

"directoryname/name.php"

 

I hope this will help you.

<?php include("name.php"); ?>

 

This is the basic php include code and just as an addition if the file is located 1 file under you do ../ is it 2 files more under then it's ../../

else file up

"directoryname/name.php"

 

I hope this will help you.

 

theres sorta a better way to do this i'd do something like, defining a site path

 

define('SITE_PATH',dirname(__FILE__) . '/');

 

then use it like this

 

require SITE_PATH . 'common.php';

 

however if the dir is 1 level below you will need to do

 

require dirname(SITE_PATH) . '/common.php';

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.