Forum Moderators: open

Message Too Old, No Replies

Passing variables through SSI includes

         

Jakotsu

4:47 pm on Nov 9, 2005 (gmt 0)

10+ Year Member



The shared menu I'm about to implement through SSI has the following iframe to show ads:

<iframe align="center" src="xml_728x90.php?as_categ_id=1655" width="736" height="76" scrolling="no" marginwidth="1" marginheight="1" name="MLAD" border="0" frameborder="0">
</iframe>

However, the value for as_categ_id must change from page to page. The question is, how can I set this value when showing the menu using an shtm include such as:

<!--#include file="menu.htm" -->

It seems I can send variables through SSI, but I'll also have to modify the menu.html to accept them, if someone can tell me how to implement this I will really appreciate it.

encyclo

4:58 pm on Nov 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there any way of replacing your SSI with PHP includes? I don't believe you are going to be able to pass the appropriate variables with SSI, whereas with PHP you can set your
as_categ_id
variable in relation to the page URL, for example.

kaled

5:58 pm on Nov 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This might work

<!--#include virtual="menu.htm?param1=value1&param2=value2" -->

You would then have to use location.href.search to access the parameters.

Kaled.

Jakotsu

11:39 pm on Nov 10, 2005 (gmt 0)

10+ Year Member



Thanks, indeed I'm using PHP now. The only problem I have now is that I want to pass the page title, which has spaces; using & nspb does not work at all because the & char is a variable delimiter.

This is what I have now:

<?php include("http://mysiteurl.org/header.php?title=Page Title Goes Here&as_categ_id=1652");?>

How can I include spaces in the title variable?

Thanks!

Jakotsu

12:10 am on Nov 11, 2005 (gmt 0)

10+ Year Member



Nevermind, I already got it by sending spaces as "_" and using the str_replace function:

$title=str_replace("_", " ", $title);

Darn I'm good. :)

kaled

12:59 am on Nov 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The usual way to encode space in urls is %20

Kaled.

JeffSela

6:00 pm on Nov 12, 2005 (gmt 0)

10+ Year Member



It's also usually safe to use '+' as an encoding of spaces, for example:

[technorati.com...]