Printing Problem

This is a discussion on "Printing Problem" within the PHP Forum section. This forum, and the thread "Printing Problem are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 24th, 2005, 18:44
New Member
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Printing Problem

I have a problem while printing. I have the code

Code: Select all
<head>
<?php echo $handle; ?>
</head>

<body>
<?php 
$handle = implode('', file('main.txt'));
?>
</body>
The problem is that I cannot print anything because the echo command is used before the main command. Is it possible to display the file ?
Reply With Quote

  #2 (permalink)  
Old Jul 24th, 2005, 22:55
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
What exactly are you trying to accomplish..?

If you want to print 'handle' then do so, after you've assigned it a value.
Reply With Quote
  #3 (permalink)  
Old Jul 25th, 2005, 12:58
New Member
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Here is the full code

Code: Select all
<html>
<head>
<?php echo $handle; ?>
</head>
<BODY>

<?
if (isset($_GET['page'])) $PAGES = $_GET['page'];

else $PAGES = 'blank';  # When no page is being asked for, it will default to home. See below!

switch ($PAGES)
{

// Blank
case 'blank':
include ('main.php');
$handle = implode('', file('main.txt'));
break;

// Main page
case 'main':
include ('main.php');
$handle = implode('', file('main.txt'));
break;

// About us
case 'aboutus':
include ('aboutus.php');
$handle = implode('', file('aboutus.txt'));
break;

// Our Products
case 'ourproducts':
include ('ourproducts.php');
$handle = implode('', file('ourproducts.txt'));
break;


// Contact Us
case 'contactus':
include ('contactus.php');
$handle = implode('', file('contactus.txt'));
break;

// Form
case 'form':
include ('form.php');
$headtext = fopen("form.txt", "r");
$handle = implode('', file('form.txt'));
break;

// Intro
case 'intro':
header("Location: intro.php");
$handle = implode('', file('intro.txt'));
break;

// Catalogue
case 'catalogue_page_1':
include ('catalogue_page_1.php');
$handle = implode('', file('catalogue.txt'));
break;

default:
include ('main.php');
$handle = implode('', file('main.txt'));
break;
}
?>
</body>
</html>
The problem is that the text of head is not printed because it is before the main php code.

Any help.
Reply With Quote
  #4 (permalink)  
Old Jul 25th, 2005, 16:37
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
hi saud, sorry to interrupt here, but no images are allowed in signatures... please remove the image
Reply With Quote
Reply

Tags
printing, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Jack Franklin Webforumz Cafe 5 Jun 13th, 2008 12:04
selective printing brunette Web Page Design 9 Aug 23rd, 2006 19:17
printing out dates riotman Classic ASP 0 May 23rd, 2006 20:47
Printing bigdavemmu Web Page Design 1 Sep 22nd, 2005 19:23
printing spinal007 Web Page Design 2 Nov 17th, 2004 13:37


All times are GMT. The time now is 01:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43