0

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?

Edited by nileshbhanu

5
Contributors
26
Replies
72
Views
3 Years
Discussion Span
Last Post by diafol
0

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.

0

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.

0

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

0

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.

0

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?

0

i want to apply 30 days trial to that folder .i have no login form and nothing else how can i do it?

0

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
0

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

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()
0

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

0

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

0

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.

0

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

0

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

0

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.

0

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

0
if($exp_date >= $now)...  

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

0

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

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.