Forum Moderators: coopster

Message Too Old, No Replies

PHP Calendar - problem attempting month changes

PHP, Calendar, refresh, update, months

         

RhysThomas84

9:44 am on Apr 4, 2008 (gmt 0)

10+ Year Member



Hi I have attempted to build a PHP Calendar system which is all working quite nicely. However I am trying to get it to change months I think I understand how to do this with the "date" function e.g

$extra_months = 1;
$next_month = mktime(0,0,0,date("m")+$extra_months,date("d"),date("Y"));

however i would like to have it that when you click on a submit button it will update the same page and just refresh to get the new info for that month. I know you can add something into the form to do this e.g

<form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

and I'm normally pretty good at working this stuff out, but i cant for the life of me work out how to. Update the same table with a whole new set of info. If anyone has any ideas on this or if you need more information please let me know. Also the whole php page is roughly programmed so I dont want to post the entire source as you would probably take you a year to read through it properly. Thanks to anyone who might be able to help.

[edited by: jatar_k at 11:48 am (utc) on April 4, 2008]
[edit reason] no urls thanks [/edit]

deMorte

10:03 am on Apr 4, 2008 (gmt 0)

10+ Year Member



Your <form> seems to be right. Do you get the values from $_POST at the beginning of the script?

At the beginnig of the form page, I usually do something like:


if( $_POST ) {
// form is submitted, get values
} else {
// form is not submitted
}

I'm not sure if I got your question right. If this does not help, maybe you could illustrate the problem a bit further.