PDA

View Full Version : simple question...


jjj0923
03-29-2002, 09:43 PM
I have a template that display my top nav bar (home, register, etc). Inside the template (below the nav bar) I want to call and display my photopost/index.pl

How do I do this?

I know my link that gets the entire process fired off must href to a .php file and I have created a .php that does the following

<?php
error_reporting(7);
$templatesused="photogallery";
require('./global.php');
if ($bbuserinfo['userid']!=0) {
eval("dooutput(\"".gettemplate('photogallery')."\");");
header("Location: http://www.xxx.info/photopost/index.pl");
} else {
eval("dooutput(\"".show_nopermission()."\");");
}
?>

I can get the template to display, but it seems as though the code will not execute the call to display the index.pl

what am I doing wrong?

thanks!

- jeff

Admin
03-30-2002, 05:23 AM
It doesn't take you to your perl file because dooutput() exits the script, and you don't want that.
You need to change that line to:
eval("\$photogallery = \"".gettemplate('photogallery')."\";");
But that's not enough, because a location header TAKES you to the file, doesn't INCLUDE it. And sorry I can't help you from here because I know very little about Perl. :)

jjj0923
03-30-2002, 08:45 AM
Firefly, thanks for the insight. I dug deeper into the dangerous depths of doom last evening and discovered there was no holy grail in php that would give me what I wanted. I discovered the syntax shown above that binds a template to a variable and discovered that the standardredirect templates merely uses a meta refresh tag, not a lucsious bit of php programming wizardry that I had hoped for.

I am reluctantly resigned to the fact that I will actually have to (he coughs and chokes) duplicate code and"mimick" my vb page header inside an shtml file that can be called by the perl code at the top of every page. The only solace I take in this endeavor is that at least the same shtml file can be called from the perl modules. This does annoy me however since I could do exactly what I want in a java envoriment, but my hosting company does not support JRE.

Oh well - a coding I go.

thanks,

- jeff