Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Printing Code Examples


I am building a tutorial site, all is working apart from 1 thing.

If i type in some php code even basic stuff like

<?php echo date ('Y'); ?>

then when its submitted into the database the php gets stripped away i'm using the tinymce editor if that helps make it clear.

I need to be able to show code examples as my tutorials are for web design does anyone know a way of showing code.

I can disable the tinycme editor and type code right into the textfeild and use the html safe values like: &lt;?php echo date ('Y'); ?&gt;

but thats not a good solution as i want to use the tinymce editor as my members will be able to write some tutorials.




View Complete Forum Thread with Replies

Related Forum Messages:
Printing Examples
Does anyone have any examples of how to send web page content to the
printer? I've looked at the PHP manual and I think I know how to do it
but I'd like be sure:

I have to open the printer first
Then I use the print write call?
Then I close the printer

View Replies !
Looking For Recent Visitor Code Examples/ideas
I am working on updating my content management page and wanted to overhaul my "recent visitor" code. The code that tracks who has been and is still on my pages.

I have not been able to find some examples I saw here a few months ago and was wondering if anyone could point me to some examples.

The more versatile the better.

View Replies !
Any Good Examples (applications) Of Advanced PHP Code Out There?
I'm a perl programmer interested in a good application or two to
download and examine in order to learn from. Anyone know of any such
things?

View Replies !
Is There Code Available For Printing Checks Or Tax Forms?
I'm wondering if anyone knows of any code out there that someone might
be sharing to generate the printing dimensions required for printing
bank checks or tax forms such as 1099s?

What I'd like to do is to have PHP query a database, grab the
information, and then print out to the printer on these forms and checks.

I was hoping a lot of this code was already out there somewhere. Is it?

View Replies !
Generating Code With PHP Printing To Multiple Lines
I'm trying to add several lines to a Javascript portion of a php that look like this:

filecal13.addDisabledDates("9-12-2007 ","9-13-2007 ");(with different dates, of course)

When I echo the code to a viewable part of the page using
$cname . '.addDisabledDates("' . $array[$i] . '","' . $array[$i+1] . '");it prints correctly, but using the same code in a Javascript section of the source gives me
cal14.addDisabledDates("9-12-2007
","9-13-2007
");

on multiple lines, and of course my javascript doesn't like that.  I've been screwing with it for a while now and can't seem to figure it out.  Any ideas?

View Replies !
GD Module Examples
Anyone here used, or is using PHP's GD module in their web design? I would be real interested in seeing what anyone has done with it on their web site with perhaps some sample code which demonstrates how they did it.

View Replies !
E-Mailing Examples Help.
I have created a form, which will allow a person to upload a picture,
and leave me mail. What I am having problems doing is, having the
form actually upload the picture and attach it to an email that is
then sent to me. If anyone knows of any sample code I could look at,

View Replies !
Pagination Examples
Basically im asking if anybody knows of any example code or tutorials where i can learn how to paginate a PHP page. I have a mySQL news table which holds stories as mark up. Ive had a look at a few examples and tutroials but most seem to have the the pages of the story in seperate rows in the database. Im also just confusing my self now with the multitude of options. Im using e107 as the back end by the way.

View Replies !
Pagination Tried Several Examples
I'm having some difficulties with php pagination. I tried several sample codes provided on the net but none worked.

View Replies !
Looking For Examples Of Huge MySQL & PHP
Does anyone know of any existing operational web sites where a massive (ie. millions of records) MySQL database combines with PHP to provide a directory service? I'm thinking along the lines of the White or Yellow Pages or similar. I ask because I'm researching a project which provides a (large) web-based specialist directory service, and I'd like to be in contact with people who've already done it with MySQL and PHP. I use MySQL and PHP all the time for small applications, but I'm not sure how they compare (in terms of speed and reliability) in the commercial world against the expensive alternatives.

View Replies !
Examples Of Using Inherance And Interfaces In PHP 5
As many of you knows, Zend has relased the Beta version of PHP 5. I
have allready make some tests of interfaces, classes inherance, static
and public variables, etc, and everything looks ok. Now, when you work
with PHP the most common thing is to do something with databases, you
have somehow the "same kind of pattern" like: logins, update, add,
delete data from de db, show data and that is it.

Now, I will like to use the new PHP 5 features in my next project. I
was trying to desing some clases and inferfaces for the "pattern" that
PHP use to have, and have not come with any good worthy idea. I know
Java too, so I was very happy about the the new features in PHP5 and
looking to use object model features. Im looking for very clear
examples on, how you have used the new features in PHP5 to do the "old
PHP thing"?

View Replies !
PHP Tutorial Or Project Examples
I've worked with ASP, ASP.NET and
WebSpeed in the past, but now I'd like to learn PHP. I've already
gotten a Fedora web server up and running with Apache and MySQL.

I'm looking for some examples - or even better a free project - to look
over and see how other are using PHP to read/write records to and from
MySQL. I'm trying to create a very simple web based contact management
system that will store data in a couple of tables.

Can someone recommend any examples or web sites to refer to? I'm about
to dive into the PHP manual, but I'd like some other material to study
as well.

View Replies !
Pointer Examples Of Cleaning
I have managed to create a very basic CMS, the CMS cover 6 pages and each page can have its title, pagetext, image link 1 and 2 altered.

I have doen the best I can but, I imagine that the code I have produced is somewhat ugly and could be clearer and slimlined. I have included the code for both the form page and the post page. Code:

View Replies !
Examples Of Autoloading Object
I'm a bit confused with autoloading objects.

This is only for PHP5, correct?

All autoloading functions start with "__" correct?

And can someone give me a easy to understand example of an autoloading object? I googled, but I still have questions about it.

View Replies !
MySQL Transactional Examples
Does anyone have any examples of using Transactional processing of
MySQL with PHP? I'm not sure if the BEGIN statement needs to be in
front of my SELECT statement or processed before hand by itself.

View Replies !
Examples To Display Day Calendar Schedule?
I am trying to find some code to help me along with dsiplaying a day
schedule. For example, a linear time-line with appointments blocked out or
colored differently.

View Replies !
Examples Of Well Written Large PHP Projects
To improve my PHP I've decided to study the source code of a medium to large open source PHP application. Can anyone recommend any applications that they would consider prime examples of well written PHP? The sort of attributes I'm interested in are basically just good software engineering such as clean internals, being well designed, good use of abstraction and also perhaps being well tested (things where there is a lot of room for improvement in my code ).

View Replies !
Searching For PDFLIB Working Examples
Can someone help me or point me to a place where I can find examples about PDFLIB that are written in PHP5.

The Examples that are provided with PDFLIB are not working. Missing fonts, images,...

View Replies !
File Upload :: Good Working Examples?
I want to make a file upload using php, but everytime i get an error
"File name not given". Any hints why this is happening? I used a sample
from php.net, and other php sites, but all samples are basically the
same. Maybe someone from you has a good and working example?

View Replies !
Real Life Examples Of Mysql+session_set_save_handler
In my test setup using my own session handlers with session_set_save_handler and mysql, the session handler opens and close mysql connections.

But what if my page also requires some mysql queries? Should I open a new connection or use the already opened one (opened by the session handler)?

I have made it a good practice to close a connection after a query but if I do it with only connection open no session data will be written to my mysql table.

I have seen some scripts using persistent connections but are not sure what would be the best for a real world environment.

View Replies !
Printing With Php
I am printing songs titles on the CD jacket with php.
Well,songs are in a directory. I easily list the titles on my brower page. But when I want to send these titles to the printer with:

printer_draw_text($handle,$s,10,10)

the printer prints the last titles on one line and that's all.

$s is the list.

is it a problem of time processing with the printer?
should I format $s?

View Replies !
Printing $
I am writing a php program and I need to print out the $ character. Does anyone know how to do this?

View Replies !
Printing In PHP
I'm considering using PHP for my CPT6 coursework, the only thing is that reports need to be printed out. I was just wondering how would I go about printing physical information out to the printer?

View Replies !
Printing Twice
I'm trying to grab an RSS feed and strip the "[category]" crap out of the title and then fix the download link to point to the file instead of the page. That much works but it's printing every line twice. If I just do one or the other it works like it should and doesn't even double up the stuff that it's fixed.

<?php
header("Content-type: text/xml");

$link = "http://www.torrentspy.com/rss.asp?";
if ($_GET['mode']) $link .= "mode=". $_GET['mode']. "&";
if ($_GET['id']) $link .= "id=". $_GET['id']. "&";
if ($_GET['db']) $link .= "db=". $_GET['db']. "&";
if ($_GET['query']) $link .= "query=". $_GET['query']. "&";

$lines = file($link);

foreach ($lines as $line_num => $line) {
echo ereg_replace("<title>[.*].(.*)</title>", "<title>1</title>", $line);
echo ereg_replace("<link>http://www.torrentspy.com/torrent/(.*)/.*</link>", "<link>http://www.torrentspy.com/download.asp?id=1</link>", $line);
}
?>

View Replies !
Printing!
I'm working on a project that requires to print automatically every time a page loads. The thing is, I need to print to the server printer from the clients browser without any print dialog. Eventually the web based aplication will be used from PDAs.

I've already tried the printer functions but I found them very limited, the reason, the are only printing text and some graphics but the whole document 'javascript:window.print()' style I want.

View Replies !
Printing < And > In Php
this is a real easy problem, its just that ive gone brain dead. :D

I need to print < > in a text statement but i cant do it. ive tried the normal culprits (< and "<") just not working.

i need something like:

for ($a=0; $a < $i; $a++){
$user = mysql_result($result1,$a,"name");
$email2 = mysql_result($result1,$a,"email");
$mailheaders .= "$user <$email2>";
}

View Replies !
PHP Printing
I am trying to write a script that will fire a bunch of forms to a printer when a user clicks submit on a form. Right now I am having problems getting a simple test page working. Here is my script:

<?php
$printer = "\SERVERNAMEPRINTERNAME"; //This info has been changed for privacy reasons
$handle = printer_open($printer);
printer_write($handle, "This is a test print");
printer_close($handle);
echo $printer;
?>

I get the following error:

"Warning: printer_write(): supplied argument is not a valid Printer Handle resource in c:inetpubwwwrootdevprint.php on line 4

Warning: printer_close(): supplied argument is not a valid Printer Handle resource in c:inetpubwwwrootdevprint.php on line 5"

View Replies !
Printing
I need to create some reports for printing from my database. From everything I can find using Google, there doesn't seem to be any ways to override the default header and footer. Is this still true? Any good workarounds out there?

View Replies !
Getting And Printing Last Id From A Table
I'm trying to get the last id from an orders table and increment it by one so the order_id of the new items in a shopping basket will be assigned the order_id suitable

i.e.

current order id is 5 get that number 5 and increment it by one, so that items have order number 6 assigned to them.

Im using this code so far...

View Replies !
Printing A Picture
I have some if statement where I want have a picture show instead of echoing text. The picture will be saved in another area so just doing the regular "picture.gif" will not work I will need to do the entire address.

View Replies !
Printing Source
Is there an easy way to print the source code, i guess saving it into a normal txt file would do but to keep the colours similar to when posting in here with PHP code,

I think i remember seeing a site that had an extension, like file.phps that printed the code in a colour format.

View Replies !
Printing Xml From NuSoap
I'm using the nusoap class to query a webservices server. I'm getting some errors from the web services server and I would like to print out the xml that the soapclient class and call method creates that it sends to the webservices server.

I would like to do this to compare the xml being sent to what the webservices expects. Does anyone know how to print out this xml? I can't seem to track it down.

View Replies !
Printing Under Windows
I'm wondering whether anyone knows of a good tutorial on how to use the PHP Printer Functions under Windows.

I've been dabbling in it a little, but the PHP Manual is kinda flakey on the subject.

I want to be able to print a report, generated in PHP, on the printer connected to the web-server (it's for an Intranet app).

View Replies !
Printing On Demand With Php
I am trying to generate a text file and print it all in one fell swoop with php. I know that VB has a subroutine called printondemand that makes a button in a browser initiate the WinPrint32.dll Does php have any functions that are similar to this, and if not how might one achieve something like this?

View Replies !
Printing Data?
why the following code isn't printing any data from the selected database. PHP Code:

View Replies !
Printing *.php Search To *.htm
I've got a search(search.htm) page that searches(find.php) the database and pulls Player, Pos, and Team. Right now the script runs a prints in find.php. I want this to print to search.htm. I've looked at php.net but haven't been able to find much that clicks in my head....I've got the search script that works fine but the printing is what I would like to change.

View Replies !
Printing Problem
I try to print to a dot matrix printer but when I use the set_option function,I cannot get the printer working correctly. For example I give landscape format but this seems to be ignored.This thing happens also with custom_paper_format. Is there a solution for it?

View Replies !
Printing Directly From PHP
Currently I work in a school and I wish to build a PHP/MySQL portal which allows teachers to enter student exam marks online through the portal.

The same site will provide reporting etc. and prints the result of each student on a separate page, which can then be sent by post.

In order to print the results I wish to create a print button (or something similar) which once pressed, extracts the individual student details from the Database and sends them directly to the printer without outputting anything on the screen. IS this possible with PHP?

View Replies !
Custom Printing
is it possible to print certain details on a fixed area of a paper
using PHP?

here's the scenario:

i'm trying to print labels with names and addresses. the names and
addresses are stored in the database.

after i retrieve the details, i should be able to print as many (or as
less) number of details as many (or as less) number of times at a
specified position.

for example if i have a sheet of paper that can hold 12 addresses with
4 rows and 3 columns, i can have the page marked areas as

a11 a12 a13
a21 a22 a21
a31 a32 a33
a41 a42 a43

each of which denotes a label.

is it possible to print the label say at position a32? or 2 labels
starting at position a33 and a41? (assuming we are printing it in a "Z"
format)

View Replies !
Printing Next Link!
Having trouble printing next / prev links. PHP Code:

View Replies !
Only Printing First Row Of Array
Only the first row of this query is printed. The $Agent variable is gained from a previous query that a sucessfully returns an array of names. Code:

View Replies !
Problem W/ Printing
1) my add works fine, pushing info into mydb
2) select * from mydb where month = 08 works fine, info is good
3) using view form can select only those with month = 08
4) problem is when printing sometimes month prints, sometimes not.

Example: Start Time: 16, 2003
Should be: Start Time: August 16, 2003

Sometimes month is printed, other times not. Using August as an example, it's not just August entries. I'm not seeing what would make some print correctly and others not. The db is fully populated with a month for each entry. I'm not sure how to post code, but I'll try: Code:

View Replies !
PHP Printing Reports
I need to know about your expirience with printing reports on client machine. I usually make printer friendly page, but I need to know how to make page break (how to force it).
I need to print logo on every page, so I need to know how to make a page break.

View Replies !
Print - Not Printing
I am totally new to php
Question:
I am working on a Vista box.
*.php files are displayed OK by the browser,
however,
print("something");
does not lead to "something" being displayed.
What is the cause / what should I do?

View Replies !
-> Printing PDF Files? <-
I'm using fpdf to create a report in PDF.

Now the problem is that I want to print it directly to the
client's default printer, with no intervention from the user.

Is this possible?

The problem of having the PDF file displayed in the browser's
plug-in is that:
- it lets the user change the scaling
- the user may use the browser print button instead of Acrobat
- the user will close the window thinking it's closing Acrobat
but actually closes the application itself.

I'm ready to switch to any other PDF engine/tool, including
commercial ones, if it can ease the printing process.

View Replies !
Printing PDF Files Using PHP
I generated the pdf on the fly using PDFLIB and write the PDF files in virtual directory.I want to print the PDF file in the virutal directory using PHP. I used printer_write function, but it prints the text not a file....

View Replies !
Printing Reports
I 've developed an application for secretaries in universities so as to
save the student's data, grades, etc.

One last thing I have to do is print some reports. For example all the
grades of a studentin his 4 year studies.

I think I shouldn't stick to html, because I want to manipulate the
pages as I please. I thought of making a pdf but it's not that easy.

I have seen HTML_2_PDF which uses html2ps but since the web app will be
located in a window server I leave it out.



View Replies !
Printing Every Week
im trying to print a list of every Friday since a date defined. Let me try and explain. I want to define a date such as 2007-07-06 (which is a Friday) and then let php print each Friday since that date until today. For example, if the date defined was 2007-07-06 then it would print

2007-07-06
2007-07-13
2007-07-20
2007-07-27
2007-08-03
2007-09-14

But I want to also be able to format the date it outputs, so it might look like

Friday 06 July 2007
Friday 13 July 2007
Friday 20 July 2007
and so on.

View Replies !
Printing A Pdf File From Php
printing pdf files through php. I have a
script that will create many pdf files but I want them printed. I
found this program to print pdf from the command line from
http://forum.planetpdf.com/webboard.../read?142106,52
and it works fine when I do the command

C:pdfp -p "computerLaserJet" "C:Program
Filesxampphtdocsweeklyhomebuyers empinvoice4. pdf"

through start->run but when I try to do it through php using

function print_file($filename) {
$adobe_path='C:pdfp -p "computerLaserJet"'
$output = shell_exec($adobe_path.' "'.$filename.'"');
echo $output;
}

print_file("C:Program
Filesxampphtdocsweeklyhomebuyers empinvoice 4.pdf");

View Replies !
Printing Documents
I have a web page that displays CVs submitted by users (in DOC, PDF or RTF format). CVs are stored in a folder for e.g. user_cv Admin can select the CVs to be printed and then click on Print button. This should send all documents to printer for printing. How do I do that in PHP?

View Replies !
Report & Printing (using PDF)
I've a lot of problems with print management of commercial reports.

I tried two alternatives:
1. Generation of HTML code formatted using CSS
2. Generation of PDF file

I left the first because it isn't possible to define a Footer and a Header for each page (sure?) About the second, i created a PHP class that takes a sql-query and generates a PDF file. Code:

View Replies !
Barcode Printing
I need to print barcode labels on a Birch BP-744 label printer So far I have managed to

1. create the barcode image as a jpg file
2. install MagickWand to create a bmp version of this image
3. successfully printed this on a laser printer, via parallel port, using the PHP printer_open, printer_draw_bmp, printer_close functions
4. successfully printed on a laser printer connected via USB port (found out I had to set Apache permissions)

But when I print to this barcode printer it just spits out a few rows of labels, ALL BLANK!

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved