Page 1 of 1
Need help with Calendar Script
Posted: Sat Aug 09, 2008 5:04 pm
by trouble
Hi,
I am new to PHP. I have a PHP calendar Script on a site that I am designing that uses a MySql database. My client would like for the events that have been listed on the calendar to be seen on the Home Page of the site. For example, on the right hand side of the page there is a division already coded in the CSS. I want to list the events from the calendar page there. I am not sure what I will need to do to do this. (As I said, I am very new to PHP.) Can somebody give me somewhere to start with this?
Thanks,
Trouble
Re: Need help with Calendar Script
Posted: Sat Aug 09, 2008 8:49 pm
by califdon
It's pretty hard to know what to tell you. I don't recommend that any novice PHP programmer try to modify a script that somebody else has written, beyond extremely simple text substitutions or something like that.
What we CAN help you with is getting started learning how to write your own scripts to do things like you're describing. There are, as always, two parts to such an undertaking:
- Learning the rudiments of the syntax; and
- Having a very clear understanding of the precise logic you want to implement.
So PHP is a language for processing at the server, before anything is sent to the browser. PHP can interact with the server and with a database and with variables returned from a previous HTML page, to determine exactly
what HTML to send to the browser. In your case, it sounds like you will have a database containing data on events scheduled for certain dates. You will need to write a query, using the current system date, to determine which events you want to show in the web page. You may need to constrain the output to a maximum number of lines, or events, or something. Your .php file may contain a mixture of HTML and PHP. Anywhere you need to use PHP (such as interacting with the database and generating certain parts of the HTML, namely the calendar data), the PHP commands must be within a block beginning with the token
<?php and ending with the token
?>.
Some good references to begin learning the syntax are:
http://w3schools.com/php/default.asp
http://us3.php.net/tut.php
Re: Need help with Calendar Script
Posted: Sun Aug 10, 2008 1:24 am
by desmi
What do you have now? Have you written any code yet?
If all you need help with is loading calendar events from database, you propably already have some script that puts events there?
Re: Need help with Calendar Script
Posted: Sun Aug 10, 2008 1:11 pm
by trouble
Yes, I do already have the calendar working.... Here is the URL for the calendar.....
http://www.premierewebdesign.net/CCSI/c ... /index.php
What I am trying to do is show the events that are listed on the calendar on the home page Please see
http://www.premierewebdesign.net/CCSI/index.html
On the right side of that page you will see a column that says Upcoming Events..Right now it just has some placeholder text. But that is where I would like the Events that are on the calendar to be displayed.
Re: Need help with Calendar Script
Posted: Sun Aug 10, 2008 1:13 pm
by trouble
The events do already write to the database from the calendar.
Re: Need help with Calendar Script
Posted: Mon Aug 11, 2008 6:31 am
by desmi
Im not sure how that calendar of yours work, but simple fetch from database and then echoing it in the right place would work?
Not quite sure if i got the question right..