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.

Inserting Third Party PHP Into Exisiting HTML

Featured Replies

Hi

 

 

I have PHP on this page http://foxlanesportsclub.co.uk/beta/main.php and i want to insert the coding into an existing webpage in which i have built. When i insert the code i get the following error.

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sites/foxlanesportsclub.co.uk/public_html/beta/php/main.php:12) in /home/sites/foxlanesportsclub.co.uk/public_html/beta/php/main.php on line 43

 

Here is the PHP im trying to insert

<? 
/* Include Files *********************/
session_start(); 
include("database.php");
include("login.php");
/*************************************/
?>

<html>
<title>Jpmaster77's Login Script</title>
<body>

<? displayLogin(); ?>

</body>
</html>

 

and here is the overall coding of the webpage when php has been inserted, which returns an error

 

<html>
<head>
<title>main</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (main.psd) -->
<table width="964" height="801" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td colspan="4"> </td>
<td colspan="6">
<img src="images/main_02.gif" width="690" height="58" alt=""></td>
</tr>
<tr>
<td>
<img src="images/nhome.gif" width="88" height="38" alt=""></td>
<td>
<img src="images/ncricket.gif" width="95" height="38" alt=""></td>
<td>
<img src="images/ntennis.gif" width="89" height="38" alt=""></td>
<td colspan="2">
<img src="images/nbowling.gif" width="103" height="38" alt=""></td>
<td>
<img src="images/nsocial.gif" width="88" height="38" alt=""></td>
<td>
<img src="images/ncatering.gif" width="106" height="38" alt=""></td>
<td>
<img src="images/nfunctionroom.gif" width="163" height="38" alt=""></td>
<td>
<img src="images/nresults.gif" width="99" height="38" alt=""></td>
<td>
<img src="images/ncontactus.gif" width="133" height="38" alt=""></td>
</tr>
<tr>
<td colspan="10">
<img src="images/main_12.gif" width="964" height="259" alt=""></td>
</tr>
<tr>
<td colspan="10"><table width="964" border="0" cellspacing="0" cellpadding="0">
 <tr>
<td height="445"><div align="center"><? 
/* Include Files *********************/
session_start(); 
include("database.php");
include("login.php");
/*************************************/
?>

<html>
<title>Jpmaster77's Login Script</title>
<body>

<? displayLogin(); ?></div></td>
 </tr>
</table></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="88" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="95" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="89" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="2" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="101" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="88" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="106" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="163" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="99" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="133" height="1" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>

 

Obviously im doing something wrong when i insert the code, please can you tell me how to correct this.

 

Many thanks in advance

You have to put the session_start() bit right at the TOP of the page - before the <html> code - it's telling you it can't start the session because the (HTTP) headers have already been sent.

  • Author
You have to put the session_start() bit right at the TOP of the page - before the <html> code - it's telling you it can't start the session because the (HTTP) headers have already been sent.

 

Sam G, so simple when you know how thanks alot. sorted.

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.