Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2001-06-07
9
Medium Priority
?
217 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 1200 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

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!

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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…
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 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…

705 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