Jump to content

[SOLVED] php calendar issue


updwebmaster

Recommended Posts

My calendar system is based on an iframe inside of a php page. I'm trying to get the page to automatically change the default calendar for the month using the date(n) string. This is my current code for the page:

<?php
$month = echo date(n);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<title>Calendar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="CSS/calendar.css" />
<style type="text/css">
.style1 {
text-align: center;
}
.style2 {
border: 1px solid #ff0000;
background-color: #000000;
}
.style3 {
font-size: xx-large;
}
.style4 {
text-align: left;
}
#menuShow{
border: 1px solid #666666;
background-color: #111111;
padding: 13px;
font-size: 13px;
font-family: Verdana, Arial;
position: absolute;
width: auto;
height: auto;
}

#menuSelect{
border: 1px solid #666666;
background-color: #111111;
padding: 13px;
font-size: 13px;
font-family: Verdana, Arial;
position: absolute;
width: auto;
height: auto;
}
</style>
<script type="text/javascript" src="js/menu.js"></script>
</head>

<body style="color: #FFFFFF; background-image: url('images/star_wars_battlefront_2_913200514441pm902.jpg')">
  <div id="menuSelect">
    <a href="#" onClick="moveOnMenu();moveOffSelector()">
      <center>
        <img src="images/UPD%20symbol.jpg" width="26" height="26" border="0" />
        <font size="1pt">
          <br />navbar
        </font>
      </center>
    </a>
  </div>
  <div id="menuShow">
    <a href="#" onClick="moveOffMenu();moveOnSelector()">
      <img src="images/UPD%20symbol.jpg" width="40" height="40" border="0" /><br />Click To hide this menu
    </a>
    <br />
    <iframe 
    src ="Navbar/Navbar.htm" style="width: 270px; height: 278px" id="Navbar" frameborder="0" scrolling="no">
    </iframe>
  </div>
  <div id="masthead" class="style1">
    <table style="width: 100%" class="style2">
	<tr>
		<td class="style3">Calendar</td>
	</tr>
</table>
</div>
<div id="top_nav">
</div>
<div id="page_content" class="style1">
<table style="width: 100%" class="style2">
	<tr>
		<td valign="top" class="style4">Below is the calendar for upcoming 
		events in {UPD}. Admins and members, you will be notified by e-mail of upcoming 
		meetings.<p class="style1">
        <iframe src ="Calendars/<?php $month ?>.htm">
        Your browser does not support inline frames or is currently configured not to display inline frames.
        </iframe>
		</p></td>
	</tr>
</table>
</div>

</body>

</html>

This is the page: http://www.uberpilotdudes.com/Calendar.php

What's wrong with my code?

I'm kinda new to php so I need help.

Link to comment
Share on other sites

ok I was looking at putting a "case" string in the php so that I could make my navbar so that it would automatically bring up a certain month in that iframe... do you know how to do that?

the problem is that I tried another one earlier and it didn't work. I don't have the script with me now.

Link to comment
Share on other sites

Did you try changing what I told you to?

 

ok I was looking at putting a "case" string in the php so that I could make my navbar so that it would automatically bring up a certain month in that iframe... do you know how to do that?

the problem is that I tried another one earlier and it didn't work. I don't have the script with me now.

 

Your going to have to explain that a little more...

Link to comment
Share on other sites

Did you try changing what I told you to?

 

ok I was looking at putting a "case" string in the php so that I could make my navbar so that it would automatically bring up a certain month in that iframe... do you know how to do that?

the problem is that I tried another one earlier and it didn't work. I don't have the script with me now.

 

Your going to have to explain that a little more...

 

I'm trying to make my calendar so that it will have links to have a specific month to appear in the iframe located on the php page using the "?" after the address. I used another code that allowed me to use something like this in the address bar. http://www.uberpilotdudes.com/Calendar.php?action=1 I was wondering if you know how to do a code like that.

Link to comment
Share on other sites

You could do this

 

<?php

if (isset($_GET['action'])) $month = $_GET['action'];
else $month = date(n);

?>

 

Now if action is set in the URL, it will display that month. If there is no action, it will display the current month by default. Is that what your after?

 

what would a URL look like for that?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.