Solved

set content type, set log info, http set unknown and other

Posted on 2001-06-07
9
214 Views
Last Modified: 2008-03-06
Hi,
I need to have a template written in PHP (I've never used it) that does the following. Can you help me?

set_content_type "image/gif"
set_log_info "[urlsubst $uv(tag) -unsubst]"
set now [clock seconds]
set now [clock format $now -format "%a, %d %b %Y %H:%M:%S GMT" ]
set header "Last-Modified: " $now "\r\nPragma:
no-cache\r\nCache-Control: no-cache\r\nExpires: Thu, 01 Dec 1994 16:00:00
GMT\r\n"
http_set_unknown $header

file /ivwpixel/content.gif

The last instruction must return the gif file.
Thanx in advance, Michele
0
Comment
Question by:css
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 8

Expert Comment

by:us111
ID: 6164356
?? the content.gif will contain what ??
0
 

Author Comment

by:css
ID: 6164387
must return a gif file but the most impostant part is the previous ...
0
 
LVL 8

Expert Comment

by:us111
ID: 6164413
yes a gif file but what the content ?? a date ??
do you use php image function
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:css
ID: 6164472
I want that the template returns something that fills the image tag of the following template written in tcl that I have to translate in php.
Thanx

<html>
<head>
</head>
<body>
{{{tcl
     out {<IMG src="/test/contenttag?tag=} [urlsubst "CP:SUCHE"] {&utime=} [clock seconds] {" border="0" width="100" height="100">}
}}}
</body>
</html>
0
 

Author Comment

by:css
ID: 6164475
I want that the template returns something that fills the image tag of the following template written in tcl that I have to translate in php.
Thanx

<html>
<head>
</head>
<body>
{{{tcl
     out {<IMG src="/test/contenttag?tag=} [urlsubst "CP:SUCHE"] {&utime=} [clock seconds] {" border="0" width="100" height="100">}
}}}
</body>
</html>
0
 

Author Comment

by:css
ID: 6164476
I want that the template returns something that fills the image tag of the following template written in tcl that I have to translate in php.
Thanx

<html>
<head>
</head>
<body>
{{{tcl
     out {<IMG src="/test/contenttag?tag=} [urlsubst "CP:SUCHE"] {&utime=} [clock seconds] {" border="0" width="100" height="100">}
}}}
</body>
</html>
0
 
LVL 8

Expert Comment

by:us111
ID: 6164534
samples of gif creation

<?
Header("Content-type: image/gif");
$string=implode($argv," ");
$im = imagecreatefromgif("images/button1.gif");
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageString($im,3,$px,9,$string,$orange);
ImageGif($im);
ImageDestroy($im);
?>

but it means that you need php compiled with the gif extension.
do you have it ?
0
 

Author Comment

by:css
ID: 6164559
Ok, but I need to set also these variables because I need to have never the page cached from a client. Variables are:

set_log_info "[urlsubst $uv(tag) -unsubst]"
set now [clock seconds]
set now [clock format $now -format "%a, %d %b %Y %H:%M:%S GMT" ]
set header "Last-Modified: " $now "\r\nPragma:
no-cache\r\nCache-Control: no-cache\r\nExpires: Thu, 01 Dec 1994 16:00:00
GMT\r\n"
http_set_unknown $header

Can you help me? Thanx
0
 
LVL 3

Accepted Solution

by:
rycamor earned 300 total points
ID: 6189334
As I understand it, the above variables are all raw headers, and then you are piping 'content.gif' to the browser.

PHP doesn't have direct header functions: it simply has a generic header() function that let's you specify any raw header that you want. See http://php.net/manual/en/function.header.php

Since I don't know TCL, I can only take an informed guess at what the actual header output is supposed to look like, but your PHP file should look something like this:

<?php
header("content-type: image/gif");
$now = date("%a, %d %b %Y %H:%M:%S GMT");
header("Last-Modified: " . $now . "\r\nPragma: no-cache\r\nCache-Control: no-cache\r\nExpires: Thu, 01 Dec 1994 16:00:00 GMT\r\n");
fpassthru("/ivwpixel/content.gif");
?>

All you need to do now, is call the above file as the SRC="" attribute in any <IMG> tag, and it should work. The above code should be enough to disable caching. I don't know exactly what

  set_log_info "[urlsubst $uv(tag) -unsubst]"
  http_set_unknown $header

are supposed to do, but if you provide me the actual text of the output, or at least explain what they are, I can then translate into PHP.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question