Forum Moderators: open

Message Too Old, No Replies

How do I link to php page with Javascript values included?

         

greekdish

5:54 pm on Nov 11, 2010 (gmt 0)

10+ Year Member



I tried searching for this with Google with no luck.

I have a php website with GET links. I have the Super PHP Calendar on a page. I want to link directly to a certain date/link on that calendar page that uses javascript for the dates.

So to get to the calendar page, my href link is "/?page=events".

Once on that page, to click on a date in the calendar, the href link is "javascript:navigate("","","2010-11-29")"

So how can I make a direct link, from say the homepage, to that events calendar link? I tried "/?page=events&month=11&year=2010&event=2010-11-29" to no avail.

Thanks in advance.

Fotiman

6:19 pm on Nov 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld! You would need to look in the documentation for "Super PHP Calendar" to see what parameters it accepts via the URL. If it doesn't accept any, then your PHP page would need to handle whatever format you decide to pass in and generate the JavaScript that will cause the navigation to that particular date.

greekdish

6:38 pm on Nov 11, 2010 (gmt 0)

10+ Year Member



Thanks for the welcome. I did finally solve the problem. The Super PHP Calendar didnt accept it through the URL....but at the bottom of the page, there was this code...

<script type="text/javascript">navigate('','','');</script>

so I took a chance and added in some php code....

<script type="text/javascript">navigate('','','<?php echo $_GET['event']; ?>');</script>

Now it works like a charm!

See, you guys are good luck. =)