Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1] 2   Go Down
Print
Author Topic: Link Problem  (Read 739 times)
0 Members and 1 Guest are viewing this topic.
USDefcon1
Guest
« on: June 14, 2004, 09:25:00 PM »

Ok heres whats going on, I'm tring to use php includes to include the CalendarScipt into my already build webpage. Now this works fine, the page gets included fine but when you click on a link it takes you to the link but remember now that it will not be associated with the file that I had used an include function in. So it will be a fresh new page being loaded not my page with the CalendarScript link. Well to fix this I simply used a php variable to make it so that my page includes what the variable is set to. Like this...
www.mypage.com?page=http://www.mypage.com/cgi-bin/calendar.pl

I also reset the variable that calendar script uses to create it's links so that it reads like the link above. Now this work fine but now I have a new problem which I don't know why it is doing. When you click on a link to say change the month of the calendar say January the link to do that on my page reads.
www.mypage.com?page=http://www.mypage.com/cgi-bin/calendar.pl?month=1

This works but lets say I want to go to another month, say Febuary, nows where the problem starts. The link to Febuary reads like this
www.mypage.com?page=http://www.mypage.com/cgi-bin/calendar.pl?month=1&month=2

Notice how the month variable got repeated agian, this does not produce the results I was looking for and I don't understand why it does this, and it only repeates twice, what I mean by that is the variable only repeates twice. So if I where to click on another link say the month after that it would link to...
www.mypage.com?page=http://www.mypage.com/cgi-bin/calendar.pl?month=1&month=3

Wierd, anyone know why it does this? Please help!

Also I did not change the $base_dir because I changed it once to where it was located "www.mypage.com/cgi-bin/" and it made the page blank after that so I left $base_dir alone.

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: June 14, 2004, 09:56:00 PM »

** anyone know why it does this? **

Because that's the way it is designed to work.

** and it only repeates twice **

Yes because CalendarScript deletes the extra ones when it assembles the new links for the page. It only acts on the final most one.

Did you look at how CalendarScript's URL works when it's on its own (ie. not included into your page)?

** Notice how the month variable got repeated agian, this does not produce the results I was looking for **

Why? What does it produce?

Maybe a link to your real installation would help us to see what's going on ourselves?

BTW. When including the script the way you are, what happens to the cookies CalendarScript sets??

Dan O.


[This message has been edited by DanO (edited June 14, 2004).]

Logged
USDefcon1
Guest
« Reply #2 on: June 14, 2004, 11:15:00 PM »

What I mean by it doesn't produce the result I'm looking for is that the page no longer changes the month when you click on a link, it stays on the same page. Here is the link.
http://www.s88781369.onlinehome.us/personal/planner.php?page=http://www.s88781369.onlinehome.us/personal/cgi-bin/calendar.pl
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: June 15, 2004, 07:15:00 PM »

** the page no longer changes the month when you click on a link, it stays on the same page. **

I don't know what would cause that. How are you including the CalendarScript code into the planner.php page?

Dan O.

------------------

Logged
USDefcon1
Guest
« Reply #4 on: June 15, 2004, 09:27:00 PM »

I'm using the php function: Require($page)
Logged
USDefcon1
Guest
« Reply #5 on: June 15, 2004, 09:29:00 PM »

I am not, I'm using Include(). Sorry about that.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #6 on: June 15, 2004, 09:36:00 PM »

Sorry but I don't know why CalendarScript isn't handling the query string properly when called that way except unless it's the 2 question marks in the URL now.

Maybe if Matt drops by he can offer a suggestion?

Dan O.

[This message has been edited by DanO (edited June 15, 2004).]

Logged
USDefcon1
Guest
« Reply #7 on: June 16, 2004, 12:20:00 AM »

I would think that it would work but you just never know, technology can be wierd some time. I hope that someone can help me out on this one because I would really like this to get working because I think it really looks nice that way.
Logged
USDefcon1
Guest
« Reply #8 on: June 16, 2004, 12:52:00 PM »

Agian thanks for your help DanO
Logged
USDefcon1
Guest
« Reply #9 on: June 22, 2004, 01:30:00 PM »

Anyone?
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #10 on: June 22, 2004, 05:45:00 PM »

** Anyone? **

All I can do is guess (because you never did say exactly how your script is doing what it's doing) that when you send the calendar's URL back to your PHP script, PHP is breaking down some of the calendar's query string into its own query string variables.

Eg. In a URL like:
http://www.s88781369.onlinehome.us/personal/planner.php?page=http://www.s88781369.onlinehome.us/personal/cgi-bin/calendar.pl?month=6&date=29&year=2004&year=2004&month=8&date=6

the planner.php script may be ending up with the following variables:

page=htp://ww.s88781369.onlinehome.us/personal/cgi-bin/calendar.pl?month=6

date=29

year=2004

year=2004

month=8

date=6

If you're just passing the $page value back to your include() PHP function, no wonder the script isn't generating the correct results.

Note: If you properly URL encode the calendar.pl query string (so the PHP script doesn't think CalendarScript's variables are its own - like in the following URL), it seems to work.

http://www.s88781369.onlinehome.us/personal/planner.php?page=http://www.s88781369.onlinehome.us/personal/cgi-bin/calendar.pl%3Fmonth%3D6%26date%3D29%2 6year%3D2004%26year%3D2004%26month%3D8%26date%3D6

Maybe that observation will help? Otherwise I'm not sure there's much anyone here will be able to help you with without seeing exactly what code you're using.

JMO

Dan O.


[This message has been edited by DanO (edited June 22, 2004).]

Logged
USDefcon1
Guest
« Reply #11 on: June 25, 2004, 12:36:00 PM »

You hit it right on the head dan0, that is exacly what it is doing. The first variable is ok but once it hits that & symbol it thinks that the page variable is over and it needs to start a new variable. Now I'm trying to fix it, all it needs is for the page variable to be a string such as...
http://www.s88781369.onlinehome.us/personal/planner.php?page="http://www.s88781369.onlinehome.us/personal/cgi-bin/calendar.pl?month=8&year=2004&month=8&date=18"

The only thing now is I can get the first quotation mark on by modifing the variable calendar script uses to create it's links but I can't get the completing one on because calendar script tacks on extra variables at the end. Do you know of an easier way to fix this then going though all the calendar script code and adding the ending quotation mark to everything. Thanks.

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #12 on: June 25, 2004, 04:04:00 PM »

You could just pass the calendar URL to the planner.php script like:

...planner.php?htp://ww.s88781369.onlinehome.us/personal/cgi-bin/calendar.pl?month=8&year=2004&month=8&date=18

(note: NO "page=" designation)

Then that whole query string should be able to be retrieved in its entirety using the $QUERY_STRING environment variable which should be able to be passed to your PHP include function.

I still don't know what you're going to be doing with the cookies CalendarScript sets and uses although if your page is just used for viewing the calendar, they may not be needed.

JMO

Dan O.


[This message has been edited by DanO (edited June 25, 2004).]

Logged
USDefcon1
Guest
« Reply #13 on: June 25, 2004, 10:40:00 PM »

Holy Crap it works, I could kiss you right now, but I will refrain   . Thanks a lot for your help, I would have never figured that out. Have a great day.
Logged
USDefcon1
Guest
« Reply #14 on: June 25, 2004, 11:52:00 PM »

 I have one last question and then I'll leave you alone I promise   Thanks for your help up to this point though, you have been extreamly helpfull.

Now I need to get the admin side working, it doesn't operate the same way the calendar side does though, even though it has a variable to set the URL in the config.txt file I can't find where it uses it. So I've looked around in the perl code and found that most of the linkage and everthing is done by a $CGI_URL variable that gets defined at runtime by the calendar_admin.pl script. It looks a little somthin like this...

# The CGI URL for call-back
$Template::CGI_URL = $ENV{'SCRIPT_NAME'} | | $ENV{'REQUEST_URI'};

Now I tried changing this to what we have discussed earlier....

# The CGI URL for call-back
$Template::CGI_URL = "http://www.s88781369.onlinehome.us/personal/planner.php?http://www.s88781369.onlinehome.us/personal/cgi-bin/calendar_admin.pl";

Yet it doesn't seam to do anything, when I try to login it just submits to itself and does nothing. Hmmm....

Logged
Pages: [1] 2   Go Up
Print
Jump to: