Forum Moderators: coopster

Message Too Old, No Replies

include statements

         

dave1236

2:53 am on Oct 4, 2004 (gmt 0)

10+ Year Member



All:

a quick question regarding included pages.

If I have two pages that are exactly the same except for the actual links they include - what I mean is the look and feel are the same, but one page has this link:

<OPTION value="http://www.example.net/click-123-456?SID=<?php print $_POST[123];?>" target="_blank" >abc

and the other has this link:

<OPTION value="http://www.example.net/click-123-456?SID=<?php print $_SESSION[xyz];?>" target="_blank" >abc

can i use an include statement for both pages? it seems to me that I cannot, since the php value is different. I was thinking of creating a variable named something like $_SESSION[def] and replacing both links with that value by defining $_SESSION[def] prior to the include statement. The issue I foresee is if a person happens to go between pages during a session, the value will not change to reflect which page the person is on. Is that correct? Am I better off simply copying and pasting the two pages, using the replace feature to make the changes?

Thanks! I have learned a ton from these posts and this boards expertise.

[edited by: coopster at 1:06 pm (utc) on Oct. 4, 2004]
[edit reason] generalized urls [/edit]

mincklerstraat

8:52 am on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A bit difficult to answer this one since you haven't specifed what def is (what it does in your script), so some things are less than clear to me. However, I can give some tips.

- session values can change from page to page, you just have to re-set them again. Setting session values before you include something in general sounds like sound enough practice to me.

- you can maybe try this out and see what result it gives you, the 'proof of the pudding' technique.