Solved

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

Posted on 2001-06-07
9
210 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now