Solved

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

Posted on 2001-06-07
9
215 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
Technology Partners: 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

627 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