Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: changing title of a webpage dynamically

by bart (Canon)
on Jun 04, 2013 at 19:49 UTC ( #1037046=note: print w/replies, xml ) Need Help??

in reply to changing title of a webpage dynamically

What you seem to be wanting is a way to pass a date as a parameter, and use today only as a default. Or, pass a relative day offset, with 0 for today, -1 for yesterday and 1 for tomorrow, for example.

It might be helpful if you didn't depend on the external program date to get the dateparts. Perl is perfectly capable of handling those dateparts itself, either on its own, or via simple, standard modules, or via more elaborate CPAN modules (and that's just one example). The latter can be used for relative date calculations; on the latter you can get by calculating the times in seconds, but watch out for summer time, and thus days that are not 24 hours long. Calculating days relative to noon, on any day, is safe.

To pass around the values, you need form variables (thus a HTML form, or equivalent), and form values processing on the server side, either via GET or POST;, which you are already using, will do fine.

For the form values, you can use any button to set a hidden input using Javascript before submitting the form; or you can use ordinary links, where you convert the parameter values straight to an URL. (Ordinary <input name="d" value="x" type="submit"> isn't usable because of the mixup in HTML between the value in the form and the text on the button.)

I could elaborate and give examples on all approaches, but just one solution is enough so you'd better let us know which approach you're thinking on taking.

Replies are listed 'Best First'.
Re^2: changing title of a webpage dynamically
by tejas (Initiate) on Jun 04, 2013 at 20:04 UTC

    I am not particularly interested in the dates so I just used what I was most familiar with...

    The form method would be fine is guess but i have no knowledge of javascript. But I guess any simple solution will do

    I think i get the point of using internal modules so that we can get absolute offset... but I guess I was thinking more in terms of relative offset... like whats in table +1 or whats in table -1...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037046]
[LanX]: 1899?
[chacham]: Just paint the white house black again.
dbander snorts
LanX Gesundheit! :)
talexb wonders about dividing developers in those born before the Unix timestamp of zero .. and after. Spoiler: I'm before.
chacham remebers I am a mad scientist
[stevieb]: talexb I'm after by a few years, but we can still be friends because you live in my hometown ;)
[LanX]: White House

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2017-08-18 13:26 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (302 votes). Check out past polls.