PHP - How To Make Account Expire 9 Months From Today?
As far as I can see, this code:
Code: [Select] $this->_licence_expires = date('Y/m/d', mktime(0, 0, 0, date("m"), date("d")-1, date("Y"))); results in accounts expiring 1 year from today, right? How can I change it so that it will result in expiry 9 months from today? TIA Similar TutorialsHi all, Here i have a serious problem. I want to sought it out using PHP and MySQL only. I have a form includes fields of customer id and Account type( stored in a jump menu and includes 6 different types of accounts) <style type="text/css"> <!-- body,td,th { font-size: 18px; font-weight: bold; } --> </style> <p><img src="../images/mahapitiya 1.jpg" width="1024" height="139" /></p> <form id="form1" name="form1" method="post" action=""> <label> <input type="submit" name="button" id="button" value="Logout" /> </label> </form> <p> </p> <form action="" method="post" name="form2" id="form2" onsubmit="return Validate();"> <fieldset> <legend class="cap">Create an Account</legend> <table width="75%" border="0" cellspacing="0" cellpadding="5" align="center"> <tr> <td> </td> <td class="title02"> </td> <td> </td> <td> </td> </tr> <tr height="30"> <td width="10%"> </td> <td width="25%" class="title02" align="left">Customer ID</td> <td width="55%" class="attribute1" align="left"><input type="text" name="customer_id" class="attribute1" /></td> <td width="10%"> </td> </tr> <tr height="30"> <td> </td> <td width="25%" class="title02" align="left">Account Type</td> <td width="55%" align="left" bgcolor="#FFFFFF" class="attribute1"><select name="account_type" id="jumpMenu" > <option selected="selected"></option> <option>Savings Investment</option> <option>Shakthi</option> <option>Surathal</option> <option>Abhimani Plus</option> <option>Yasasa Certificates</option> <option>Fixed Deposits</option> </select> </td> <td width="10%"> </td> </tr> </table> <p align="center"> </p> <p align="center"> <input type="submit" onclick="return Validate();" name="submit" value="Submit" class="attribute1" /> <input type="reset" name="reset" value="Reset" class="attribute1" /> <label> <input type="submit" name="button2" id="button2" value="Help" /> </label> </p> </fieldset> </td> <td width="5%"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="center"> </td> <td> </td> </tr> <tr> <td> </td> <td><font color="red" size="1" ></font></td> <td> </td> </tr> </table> </form> <p> </p> <script language = "Javascript"> function Validate() { if (document.form2.customer_id.value == '') { alert('Please enter the valid customer id!'); return false; } else if ( document.form2.account_type.selectedIndex == '' ) { alert ( "Please select an account type!." ); return false; } return true; } </script> There are 6 different types of tables exist in my database representing 6 different types of accounts.Each and every table there is a field called "account number" which is auto incremented.When user clicks on submit button i want account number to be opened based on selected account type. How this could be done? Thanks, Heshan. hi everyone i was wondering if anyone has any idea how i can make my php links look like this "wwwDOTmysiteDOTcom/xxx.php?s=account" right now they look like this "wwwDOTmysiteDOTcom/account.php" thanks... when user login to his account, I want to expire session after 5 minutes i make a site and give a option to uploaded a file but i want to give time period so that there is time limit for downloading after that time interval file is not able to download, so please help me how can i do that. thanks how can i set a session to expire after a set amount of time, say 1 hour. i'm using the following code to create my session, but i dont know what i need to add to make it expire $_SESSION['pageviewsid'.$id] = $new; $new is the result from a calculation and $id is the page id from the URL using $_GET Hi All, if we read performance rules given by yahoo they suggest to add expire header for JS and css files. my question is how to add expire header for different JS and CSS files. reference URL :- http://developer.yahoo.com/performance/rules.html#expires Assume I have a php page that have 5 js and 2 css it may be anywhere in html document for eg <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <script language="javascript" type="text/javascript" src="test.js"> </script> <title>Untitled Document</title> </head> <body> <script language="javascript" type="text/javascript" src="test2.js"> </script> SOME HTNl CONTENT <script language="javascript" type="text/javascript" src="test3.js"> </script> <script language="javascript" type="text/javascript" src="test4.js"> </script> <img src="1.gif"> </body> </html> My question is how I will add expire header in every JS, CSS and images. I have a restriction:- I cannot use ob_start() for the output buffering. did some searching on the internet and didnt find much. i have created an online classifieds website and want all created listings to expire and delete after a certain amount of days. honestly i have no idea where to start with this implementation. cookies were the only thing that even crossed my mind... any ideas? btw each listing is stored in a table called ob_listings Assume this project is to create an online lottery system. Is there a way to limit the user entering the numbers after a certain time? E.g. The Draw will be at 9.00PM 05 November 2010 - Submitting the numbers will expire after 8.00PM 05 November 2010. (so any user tries to submit numbers after 8.00PM 05 Nov 2010 will not be entered in to the MySQL db). Any help is highly appreciated. Hi, I managed to source this code that allows me to work out how many days until a date. However I don't know how it works so I can't change it to make it work out months. Can someone kindly help me understand it? Also this code uses the unix timestamp system. $cdate = $deadlinedate; $today = time(); $difference = $cdate - $today; if ($difference < 0) { $difference = 0; $days=floor($difference/60/60/24); All help appreciated. Thanks in advance. Ok, so I have a code that looks like so: Code: [Select] <script type="text/javascript"> var ng_config = { assests_dir: 'ng/assets/' // the path to the assets directory } </script> <script type="text/javascript" src="ng/ng_all.js"></script> <script type="text/javascript" src="ng/components/calendar.js"></script> <script type="text/javascript"> var my_cal; ng.ready(function(){ // creating the calendar var my_cal = new ng.Calendar({ input: 'enddate', start_date: 'year - 1', // the start date (default is today) display_date: ng.get('startdate').value, // the display date (default is start_date) server_date_format: 'm/d/Y' // changing the server date format for a specific calendar. }); }); var my_cal1; ng.ready(function(){ // creating the calendar my_cal1 = new ng.Calendar({ input: 'startdate', start_date: 'year - 1', // the start date (default is today) display_date: new Date(), // the display date (default is start_date) server_date_format: 'm/d/Y' // changing the server date format for a specific calendar. }); }); how do I detect the months that pass between the two dates that are selected using a popup calendar using php so that my register page know which month to display the event under. Does this make sense? I'm trying to figure out for the months I can get it to display the last 5 months including the current month. The reason for this is I"m going to get the total number of hits for my website for each month as well as the number of successful logins for my CMS script. Any thoughts? Code: [Select] <table class="visualize_dashboard"> <caption> Dashboard Chart Example </caption> <thead> <tr> <td></td> <th scope="col">March</th> <th scope="col">April</th> <th scope="col">May</th> <th scope="col">June</th> <th scope="col">July</th> </tr> </thead> <tbody> <tr> <th scope="row">Visits</th> <td>175</td> <td>145</td> <td>212</td> <td>175</td> <td>182</td> </tr> <tr> <th scope="row">Logins</th> <td>94</td> <td>53</td> <td>124</td> <td>92</td> <td>105</td> </tr> </tbody> </table> Hi.. I need help in selecting first 3 Consecutive Months from my table ETD which type is Date. for example in my ETD: 2012-04-01 2012-04-01 2012-04-05 2012-04-08 2012-04-08 2012-05-01 2012-05-01 2012-05-05 2012-05-08 2012-05-08 2012-06-01 2012-06-01 2012-06-05 2012-06-08 2012-06-08 2012-07-01 2012-07-01 2012-07-05 2012-07-08 2012-07-08 2012-08-01 2012-08-01 2012-08-05 2012-08-08 2012-08-08 Now from this ETD data: I need to select only a (from April - June) 2012-04-01 2012-04-01 2012-04-05 2012-04-08 2012-04-08 2012-05-01 2012-05-01 2012-05-05 2012-05-08 2012-05-08 2012-06-01 2012-06-01 2012-06-05 2012-06-08 2012-06-08 Thank you Hello I have created a calendar with a working loop however I need help being able to 1) Add months Jan, Feb etc ( can do this) 1a) being able to click those months as links and select the day Hi I am trying to add a field to a database that is 4 days from the date the record is added, but it is not adding a value Code: [Select] $end_date=strtotime("+ 4 days"); $add_vehicle_sql=mysql_query("INSERT INTO `tbl_auction_lot`(`cust_id`,`reserve`,`make`,`model`,`spec`,`fuel`,`doors`,`mot_date`,`fns`,`fos`,`rns`,`ros`,`condition`,`reg_no`,`service_history`,`sale_type`,`status`,`keepers`,`gearbox`,`emissions`,`colour`,`date_first_reg`,`date_manufacture`,`bhp`,`engine_size`,`end_date`) VALUES ('$seller_id','$reserve','$make','$model','$body_style','$fuel_type','$no_of_doors','$mot','$fns','$fos','$rns','$ros','$vehicle_condition','$vrm','$service_history','auction','$status','$prev_keepers','$gearbox','$emissions','$colour','$date_reg','$date_man','$bhp','$engine_size','$end_date')") or die(mysql_error()); What am I doing wrong and what is there a better way to achieve the desired result. Hi, I have db field with date. I want to make select statement with where clause when part of the date (month) is true. Example, i have records from 2020-2-1 until 2020-4-3, i want to select records for march only 2020-3-1 to 2020-3-31. how to do that? Just to make things a lot simpler, I decided to start a new topic. My question is, how can I count how many months it is back to the past November? Example: May 2011 back to November would return 6. Example: Dec 2011 back to November would return 1. Example: October 2011 back to November would return 11. Jake I got 3 problems I am not able to do with the following PHP code 1) The sort function is not sorting the months in order like how I want it? Why? 2) How would I use a for loop to display the array of months? 3) How would I use a while loop and switch statements to display the array of months with # of days in each? Code: [Select] <?php $calendar = array("Janurary", "Feburary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); print_r ($calendar); echo "<h1>FOR loop</h1>"; echo "(put for loop code here)"; echo "<br>"; sort($calender); echo "<br>"; print_r ($calendar); echo "<h1>WHILE loop, SWITCH statement</h1>"; echo "(put while loop code here)"; echo "<br>"; ?> Hi, Something strange has happend today. I am from the UK the date is March 31st so I am using timezone: date_default_timezone_set('UTC'); I capture the date: $date = date("Y-m-d"); Add a month to the date: date("Y-m-d", strtotime("+1 Month", strtotime($date))) And its comming out as May. If I capture the date through the URL which I do when navigating back: $date = $_GET['date']; Its works and says April Can anyone please advise me on why this is happening. Thanks Hello All, I have a News database in which articles are entered in. Right now all the stories are being display in one big page with every story on it. What I would like to do is to create an "archive" in which it automatically organizes the stories by their date. For example. 2011 February January 2010 December November October September etc... etc... I have a datetime field for the database, and I know how to do this all manually, but I can't figure out how to make it automatically add a month each month. It would be too much maintanence to have to update this every month. I also don't know what this would be called, so I don't even know what to search for. I've tried blog and news, but doesn't seem to be what I want. Any help would be appreciated! |