Advertisement

08.24.2008 at 11:01PM PDT, ID: 23674568
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

How do I activate a php log entry when printing a external page?

Asked by NEILPH in PHP Scripting Language, JavaScript, Dynamic HTML (DHTML)

Tags: , , , ,

Here's my related question.
 
To recap, I was trying to activate a php script when printing a page. You said "If you need to have something done when

printing then you should provide a separate page for printing and a button to bring it up."

I then put <link rel="alternate" media="print" href="printme.htm" /> in the header of print_other_page.htm [see snippet 4],

and <img src="one.php?action=print" width="1" height="1" border="0" style="display: none" title="" id="printcount" />
in the body of printme.htm [snippet 5].

A bit kludgy but it works.

Now, I want the user to be able to choose the page to be printed (and preview some of it first). I need the log entry to

activate even if the user prints using the browser menu\toolbar rather than my Print button.

I've tried to solve this by creating a frameset [see snippets 1,2 and 3]. You'll see that it includes the link and img

elements from the first solution. It works fine except that it prints the default contents "Remote File:

http://www.google.com".

I've tried many variations without success. What do you think? Maybe a non-frame approach would work,e.g. pop-up preview

window, #include, iframes, a third frame to talk to the php script, an object element, onclick()?

Bear in mind that eventually I will want to send info to the php script for the log entry: user name from a cookie, the url

of the printed page.

That's it.Start Free Trial
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:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
* 1 ***************mymenu.htm****************
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="alternate" media="print" href="content.html" />
</head>
<frameset rows="131,131"> 
  <frame name="content" scrolling="no" noresize src="http://www.google.com">
  <frame name="menu" noresize src="menu.html">
</frameset>
<noframes> 
<body bgcolor="#FFFFFF" text="#000000">
</body>
</noframes> 
</html>
********************************************
 
* 2 *********************content.html************
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body bgcolor="#FFFFFF" text="#000000">Remote File: http://www.google.com
 
<img src="one.php?action=print" width="1" height="1" border="0" style="display: none" title="" id="printcount" />
 
</body>
</html>
***********************************************
 
* 3 *******************menu.html**************
<html> 
<head> 
<title>frame changes</title> 
 
			<script type="text/javascript" src='http://127.0.0.1:1027/js.cgi?pa&r=8281'></script>
 
<script type="text/javascript">
// (C) 2004 www.CodeLifter.com
function framePrint(whichFrame){
    parent[whichFrame].focus()
    parent[whichFrame].print()
}	
</script>
 
</head> 
<body> 
<base target="content" />
<p>
<a href="http://news.google.com/news?ned=us">Google News</a><br> 
<a href="http://news.google.com/news?ned=us">ISC</a><br>
 
<button type="button" name="pr_fr" onClick="framePrint('content')" style="font:1em Arial, Helvetica, san-serif; background: 
 
yellow; color: red; padding: .3em">Print selected page</button>
 
</body> 
</html>
****************************************************
 
* 4 ********print_other_page.htm**********************
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
<link rel="alternate" media="print" href="printme.htm" />
 
</head>
 
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post">
 <input type="submit" name="Submit" value="Print\Submit" onClick="window.print()">
 
</form>
</body>
</html>
*****************************************************
 
* 5 ********printme.htm*********************************
<html>
<head>
<title>css print test</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<meta name="generator" content="BBEdit 7.1.4">
 
<style type="text/css">
 
p
{
	font-family: Times New Roman, Times, serif;  
	font-size: 12px;
	line-height: 115%;
	margin: 10px;
}
 
 
div
{
	font-family: Times New Roman, Times, serif;  
	font-size: 12px;
	line-height: 115%;
	margin: 0px;
}
 
 
#thepg { 
	position: absolute;
	left: 0px;
	top: 5px;
	width: 100%;
        height: 3cm;
	border: 1px solid black;
        overflow: hidden;
	text-overflow: clip;
}
 
 
 
#noshowpic img{ 
display:none; 
} 
 
#noshowpic embed{ 
display:none; 
} 
 
#showpic img{ 
  margin: 10px;
} 
 
#showonepic img{ 
  margin: 10px;
} 
 
#showonepic embed{ 
display:none; 
} 
 
a:link
{
display: none;
}
 
</style>
 
<style type="text/css" media="all">
#printcount { display: none; }
</style>
<style type="text/css" media="print">
#printcount { display: block; }
</style>
 
 			<script type="text/javascript" src='http://127.0.0.1:1027/js.cgi?pa&r=8281'></script>
 
<script type="text/javascript">
window.onload="document.getElementById('printcount').style=''"
</script>
 
</head>
<body>
 
<div id="thepg">
 
<img src="one.php?action=print" width="1" height="1" border="0" style="display: none" title="" id="printcount" />
 
<table width="100%" border="0" cellspacing="0" cellpadding="0" name="holdit" bordercolor="#FF0000">
  <tr id="masterContainer" valign="top" align="left"> 
     <td> 
<p>
Overall 158 tests have been submitted as part of TestFest 2008 since the launch of the TestFest submission site by 30 
 
different people from people all over the world. 
 </p>   
 
 
    </td>
</tr>
</table>
</div>
</body>
</html>
 
*************************************************
[+][-]08.25.2008 at 01:46PM PDT, ID: 22309113

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 02:55PM PDT, ID: 22309594

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:00PM PDT, ID: 22309638

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:10PM PDT, ID: 22309733

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:31PM PDT, ID: 22309912

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:52PM PDT, ID: 22310070

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:58PM PDT, ID: 22310111

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 04:33PM PDT, ID: 22310316

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 01:49PM PDT, ID: 22319307

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 01:53PM PDT, ID: 22319353

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 05:12PM PDT, ID: 22320848

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 06:54PM PDT, ID: 22321216

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 09:29PM PDT, ID: 22321863

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, JavaScript, Dynamic HTML (DHTML)
Tags: HTML, PHP, JAVASCRIPT, CSS, IE6+
Sign Up Now!
Solution Provided By: NEILPH
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10.03.2008 at 09:27PM PDT, ID: 22639624

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_Related_20080208