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?

Recommended Answers

All 26 Replies

Member Avatar for diafol

You need to provide more info.
Read my sig link: "help us to help you" - a good article by pritaeas

You can store data in a DB if not by cookie maybe.

Sounds like what you are asking is to set up a trial that expires?

Member Avatar for diafol

If the client is given a login, then you can control access with DB
e.g.

user_id
username
pw
startdate
account_type [trial | full]

If account_type is trial, only allow login is startdate was 30 days or less ago.

there is no login and nothing direct start is there .user directly start application

Member Avatar for 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?

Member Avatar for 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:

deny from all

thank you sir i really happy with your sollution thank you so much

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?

Member Avatar for 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()

can you please suggest me in php 5 in which file i have to include this means in main.php form all page display or in index.php

Member Avatar for diafol

Sorry, that doesn't make much sense.

hi any one can tell me that without internet how to do expiry to web application for 30 days?

please tell me without internet how it is possible?

Member Avatar for diafol

What technology are you talking about? Is this ASP.NET? Java?

It's in PHP forum, so I assumed that you were talking about web pages. You have not been very forthcoming with your requirements, please elaborate.

yes i am talking abou php but if i want use app on localhost than how can i do this?

please tell me on localhost how can i apply expiry to application?without session and cookie.

Member Avatar for 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.

how to do hardcoding expiry?

because we have already encrypt the data?please tell me how to do hardcoding expiry?

Member Avatar for diafol
if($exp_date >= $now)...  

BUT, all the user has to do is change the system time, and good to go again.

so how it is possible please help me?

Member Avatar for iamthwee

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.

Member Avatar for 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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.