how can i apply expiry for 30 days to web app without using cookie?
i have my one app and if i want to give this app to client for 30 days on server than how can it is possible?
there is no login and nothing direct start is there .user directly start application
0
diafol
As I mentioned
You need to provide more info.
Could you please give us more information about what you're trying to do. At the moment we seem to be dragging info out of you bit by bit - it's a little frustrating.
simple i have create one folder for client in which application is there and i run it on my server after website url/foldername but how can i apply 30 trial to that folder?
i want to apply 30 days trial to that folder .i have no login form and nothing else how can i do it?
0
diafol
when you create the folder, it means everybody in the world will have access to it unless you protect it with a login of some description. Which may be okay for you, I don't know.
As soon as the folder is created, add a record to your DB table, such as
folder_id
folder_name
folder_expiry
set the folder_name to the newly created folder name and the expiry to 30 days from now. So when your client tries to access any pages in the folder, you could have this in an include file to place in each page...
//connect to db
//query folder
//get expiry date - if expired redirect to renew page - else show page
Alternatively, you could run a daily cron job to run a script to produce a .htaccess file into that folder which has the content:
i have question that with which date i have to compare expiry date.if i have to compare it with server date than how to get server date and how to compare it with expiry date format?
0
diafol
As your expiry dates will be set compared to the server (I assume), then you need to compare it the server time. The format in which you store dates in the DB will determine the SQL you have to use.
There are three popular DB 'date' formats, date (Y-m-d) datetime (Y-m-d H:i:s) and timestamp (integer).
You can check these with the server date in the same format.
If you want to check with php...
$date = date('Y-m-d');
$datetime = date('Y-m-d H:i:s');
$timestamp = time();
SELECT ... FROM `table` WHERE `expiry_date` <= '$date'
Similarly for other formats
You could however do it all in SQL:
SELECT ... FROM `table` WHERE `expiry_date` <= CURDATE()
SELECT ... FROM `table` WHERE `expiry_datetime` <= NOW()
SELECT ... FROM `table` WHERE `expiry_timestamp` <= UNIX_TIMESTAMP()
please tell me on localhost how can i apply expiry to application?without session and cookie.
0
diafol
So you want to create code for others to download onto their machines, which then expires after 30 days?
You could try hardcoding expiry into the php code and then use ioncube to encrypt the code. The problem with local php code is that it is visible, so the user could tinker with it. Likewise any DB tables.
You could use license keys, but this would probably mean a connection to the internet each time the user needed to use it.
You could maybe release a trial version with reduced functionality and then have a 'pro' version.
Sorry, this isn't really my area - all my stuff is strictly free code.
Why on earth would you want to run a php app locally?
Sounds daft to me.
Only way to do this otherwise is to create an exe or runnable file for whatever OS you are using. Then you need to work out how to write to the registry.
This isn't easy.
Edited
by iamthwee
0
diafol
Sounds daft to me
Me too.
In addition, our forum guidelines ask that you show evidence of your own work. We've seen nothing so far. Although we are here to help, we're not here to write all your code, nor to do your research for you. You've been given a few pointers, but php is not particularly suited for this.
You could run a demo on your site and ask for payment which would lead to a download.
I try to create a simple OOP PHP that shows an error:
class_lib.php
<?php
class person {
var $name;
function __constructor($person_name){
echo "Initialize class";
}
function set_name($new_name){
$this->name($new_name);
} ...