Solved

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

Posted on 2001-06-07
9
209 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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.
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 …

743 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

16 Experts available now in Live!

Get 1:1 Help Now