Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Expiring Pages


Just a quick question, is there a way to expire prev pages users look at?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Pages Expiring Too Quickly
I have several forms that are running into each other, passing variables and pretty tables. I use SID to control sessions, but here is what my problem is. (it is very easy, but I don't know how to go about it)

My pages expire as soon as user leave them. If they want to go back in order to view it again or select different link, they have to click on "Refresh" button. They all complain, how can I stop this? I did not have that problem initially it only started recently.

Dates Expiring
Whats the code to delete something if a date has expired. For example if there was a concert on 6/29/00 whats the code to delete it out of the database on 6/30/00.

PHP $_SESSION Expiring In IE 6/*
comp.lang.php,

I have recently launched the new Planet-Tolkien.com, one would think
that writing a message board from scratch and a dynamic weather
system, a simple session login would be the least of my problems
right? Wrong.

It would appear that for Mozilla and Opera keep a $_SESSION is not an
issue and the $_SESSION is continued until the member logs out.
However when members are using Internet Explorer browser (most
versions it seems), they can go around the site for varied amounts of
time, usually less than five minutes and then their $_SESSION will
expire!?

I cannot for the life of me figure out why a server side $_SESSION
would expire on IE but not for MOZ or Opera but it is, and I need to
figure out why and how can I fix this.

REF. All login information is saved as such:

session_save_path("$path/sessions");
session_start(); $_SESSION['session_memberID']=$session_memberID;
$_SESSION['session_username']=$session_username;
$_SESSION['session_groupID']=$membergroup;

Php Session Not Expiring
I've modified my php.ini so I've got

session.gc_maxlifetime = 60

and restarted my server so therefore my sessions should expires in 60 seconds right?

its not.. .. I waited for 60 sec on the page and then tried to do something and it still works

Expiring Sessions Between 2 Domains.
Background:

Client owns one ecommerce site. We're building another ecommerce site with different products/theme.

To save on costs.. client wants to use his SSL server of the first Ecommerce site for this new site.

Problem:

Initially wanted to use cookies to store the session variable which holds shopping cart contents. Can't do that because of the different domains (http://www.newsite.com AND https://oldsite.com).

Went to sessions and passed the PHPSESSID to the secure area to transfer customer data.

This works fine until the transaction is complete and we pass the visitor back to the non-secure site...session is still active UNTIL a page refresh is done by the visitor.

Even more of a problem is when I close down ALL windows.. hell even if I reboot the client computer and go back to the site the session is still active UNTIL a manual refresh of the page is done.

Can anyone help me in how I do a full proof method of expiring sessions and session data once I have finalized the order?

Sessions And Expiring Cookies
I set my session parameter so the session is a few minutes long, and if the
user goes inactive for that period the session expires. Two questions:

1) What mechanism actually expires the session? That is, what says "hang on,
the time limit has passed, so that's no longer valid"? It can't be the
browser, since that might be subverted or buggy. So does a browser send an
expired cookie value anyway and trust the website to spot it has expired?

2) How do I tell in my PHP that a session has expired? My code has a
start_session() at the top, and uses of $_SESSION[xxx] underneath, but
somewhere I should be checking that the session hasn't expired, shouldn't
I? Or maybe start_session() does that for me somehow?

Cookie Expiring Problems
I am using the following code to set a cookie for 30 seconds:
$value = $_GET[submit_enter];
if (! isset($_COOKIE['testit'])){
setcookie('testit',$value,time()+30,'/');
}
What happens:
1. On the windows apache server the cookie disappears after 30 seconds
2. On the linux apache server the cookie disappears after hours?

Fact is: Servertime is localtime

Questions:
1. Does anyone know about this problem on a linux machine?
2. Do we really need the time() to set a cookie?
3. Is there a special configuration to be done (php.ini or somewhere else)?

Cookie As Sessions Not Expiring
I read somewhere that if you set a cookie with the expiry value of 0, it becomes a session variable.  I have done so below:

setcookie("login",$username,0,"/",false);

It removes the cookie on browser close, however when other session variables expire because the user is inactive, the cookie is still active.  Any ideas on what I need to do to make it expire with inactivity as well? 

Sessions Expiring Early
I have a site where the users log in with their username and password, and it stores their info in a session. If the session variables are not detected, the pages will send them to the login page.

For some reason, users are randomly getting logged out after even 20 minutes of inactivity in some cases. I have to figure this out, but I just can't seem to put a finger on it. Here is my phpinfo() on sessions: Code:

Expiring Download Links
I assume this is possible but can not figure out how to do it. I was wondering if anyone could point me in the right direction. I want to create a script that sends customers a link that expires after 24hours. This way they can not send out the link to anyone else.

Newbie: If Then Statement And Expiring Listings
I've tried a couple of variations of coding this but i still haven't
gotten it down.

basically my query pulls all the tables within a certian search
criteria. When it shows the listings it shows a space like:

Name
Address
city, state zip
phone:
<blank space>
url

right now this is the code i have:

Session Cookies Expiring Unexpectedly
I've written a fairly straightforward session login system. And it works just great on all the computers I've tested. However, the person who is going to be using the system is experiencing a problem where once in a blue moon, seemingly without pattern or reason, after using the system successfully for awhile the session cookies expire unexpectedly and they consequently get logged out.

The code is dead simple. Stripped down, it essentially works like this.

Here's where the login page creates the auth:

session_start();
$_SESSION['auth']=TRUE;

...and on consequent pages I test for the existence of the token auth.

Apparently there were some old bugs in IE that sometimes resulted in session weirdness, but I have made certain that everyone is using the latest version of ie6. This is doubly frustrating because I have been completely unable to reproduce this bug on my end.

Has anyone ever encountered anything like this before? Can you think of anything in the configuration of a local system that would possibly cause the session cookies to expire without warning?

Query Expiring Domain Names
Does anyone have or know of any scripts which can collect data on expiring domain names? I've been looking everywhere but having no luck!

Avioding Expired Pages, & Carrying Data Accross Multiple Form Pages
I have a checkout/order form that consists of 6 pages, all PHP. The are linked to one another, like, after the user finishes page 1, they proceed to page 2, etc... The first two pages are submitted by a GET link, so those are not in my question. The next 4 are submitted using a <form>. Throughout all of the pages, i would probably have about 25-30 variables, things that the user has to fill out. I have two questions,

1. What would be the best way for me to keep track of all the data moving throughout the pages, like storing it from page 4, and i still need to access it on page 6.
2. I don't know if anyone could help me here, but does anyone know of a way to code around those ugly "page expired" pages, because of a submitted form. If a user needs to go back, which most likely they will, is there some sort of way for me to skip the expired page?

Converting Html Pages Into Dynamic Pages
I built a website in html, using Dreamweaver. I need to have a database built within these pages and the person who is going to do it told me that they will have to convert all my html pages into dynamic pages (php).

Is it complicated to do this or do I just have to save my pages in php instead of html in Dreamweaver ?

Sending People To Specific Pages That Are Coming From Specific Pages...
I want to show some specific pages to people that comes to my site from
specific urls, I know the variable $_SERVER['HTTP_REFERER'] will be
used but how?

For ex if the visitor comes from a site that is like:

I want to send this person a specific.php . I used below code but not
worked:

<?php

if($_SERVER['HTTP_REFERER'] == "www.cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "www2.cominghost.com"){

// Specific page html goes here

}
else
{
header("Location: index.php");
}
?>

This code not worked for some cases like if the visitor comes from
http://www.cominghost.com/account/targeturl.php or
http://cominghost.com/account/targeturl.php Ok I know the if statement
not working but How?

Sessions Expiring From Page To Page
I just installed a site on a client's server.  I'm using a session based login, and have the session_start() at the top of the pages I need.  However, when I first log in, the session variables I register are all there, but when I click on any page, they are gone. Does anyone have a clue as to what might be set that's cuasing this?

On The Fly Php Pages
what coding you would use to create pages based off 1 template. For example

http://www.mysite.com/index.php?page=1
http://www.mysite.com/index.php?page=2
http://www.mysite.com/index.php?page=3

So that I can edit changes to all my pages just be editing index.php.

I don't have access to a sql database so I have tried different ways of using the echo command but no luck. Does anyone know how to do this?

Utf-8 Pages And Php 4.1.1
I'm running into a problem with php 4.1.1 on IIS (XP Pro version).
For example writing a page test.php that starts with

<?php session_start(); ?>
<?php echo '<?xml version="1.0"' ?>
<?php echo ' encoding="utf-8" ?>' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en"><!-- InstanceBegin template="/Templates/stdPage.dwt"
codeOutsideHTMLIsLocked="true" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
....

and saving the test.php in UTF-8 format in UltraEdit-32 or SciTE,
then running the page, there's a complaint for session_start() about
headers/page data having already been sent. If the same page is
saved as "plain" ASCII, it works. Any ideas how to get an UTF-8
encoded page to work in php 4.1.1, without upgrading?

Web Pages
i am trying to make a homepage in PHP but something along the same lines as the frames that you can use in HTML, so it allows you to have the different frames for opening different pages, but i was wondering how i would do that within PHP.

Php To Pdf Multiple Pages
I can write a page - no problem.
when I start a second page I cannot open second page.
at the time of a page break I have tried:

php_close_page($sessionname)
php_open_page($sessionname,x-coord, y-coord)
and
php_close_pdi_page($sessionname, $pagename)
php_open_page($sessionname,x-coord, y-coord)
and just
php_open_page($sessionname,x-coord, y-coord)

It always opens and writes the first page but hangs
up when it tries to open the second page.

Secure Pages
I have a login system that checks the database for auth and sends them to the destination according to auth.

Now what I need is some way to secure the pages so you cant go straight to the pages by typing it to the browser. I would like for you to get directed to the login page if you try to go straight to the page(s). Is there some code I can put to keep from viewing the page(s) without logging in first.

PHP In Html Pages?
I have a problem. I need to include a php script in a simple html document on a server that does´nt support php.

I´ve tested following but it does´nt work..
<SCRIPT LANGUAGE="PHP"
SRC="http://www.domain.com/include.php3">

Does anybody know a solution for this problem or is it impossible?

Can I Expire Pages Myself?
I was wondering weather it be possible to have the browser say page expired or if it is posiblw to have a script that will detect the browser back button has been pressed.

How To Redirect Pages
How can I redirect the URL if URL is underlined. I mean, I made alink to the site with URL. How do I change the site with URL, so that it redirects the browser to the page defined by that URL?

Members Pages On The Fly?
I would like to make a members site, where my members can update their personal page via the web through forums. The pages would be generated by a template. I would also like these member pages to have id=10 so that it is easy to link up.

Caching Pages With Php
In this post I will try to give a view of what is the custom caching with php, why and how we can use it.In the modern days, most of the sites are database driven. That means that your site is actually an application which retrieves data from a DBMS ( database managment system, eg MySQL) , parses the data and shows the result to the user. Most of these data are usually don't change frequently or don't change at all, and the reason that we use the database is that we can easilly update the site and the content.A problem that this process creates is the server overhead. Every time we execute a query in the database, the instance of our script will call the DBMS, and then the DBMS will send the results of the query. This is time consuming, and especcially for sites with heavy traffic is a real big problem.How we can solve this problem?There are two ways to solve this if you want to make your site faster. First is optimizing the quesries, but we will not talk about this at the present article. The second and most valuable is using some kind of custom caching technique. Custom caching with phpFirst let me explain the idea behind custom caching. When we have dynamic pages that their data is not updated frequently, we can use a 'system' that will be able to create the page, and then store it for later use. That means that after the page's creation, our application will not run the queries again in order to display the page, but it will show the cached one. Of course this system must be able to keep the cached pages for a time period that we will set.Let's code itHere is a simple class that will do the job. Let's see the code first:

Updating Pages
I have embedded a PHP script into an IFRAME that queries a MySQL database to post comments. Comments can be added, and in theory, posted immediately. They do if you hit F5, but as soon as I shutdown the browser, go back to the comments page, the new comments are not there, until I hit F5. I've deleted all the temp files from my computer, so it shouldn't be that. I've tried contacting my hosting company, but they have nothing useful to say.

Caching Php Pages?
HOW to make my pages freshly loaded by default. this is a problem when pages get cached that query databases because when you go there you get the cached page as opposed to the page updated with the database's info.

how do you get pages to automatically load themselves from the server, not the cache?

Redirecting Between PHP Pages
Two inter-related questions:

If I'm in PHP page a.php, and I want to switch control to page b.php,
the only mechanism I've come across is to use header('Location:
someURL") ;

This has two drawbacks - it seems inefficient to me - you essentially
have to "bounce" a request/response off the browser to switch between
PHP pages - leaving and returning to PHP just to switch pages, and
also it uses the GET method and, I'd assume, therefore restricts you
on the length of the URL and therefore the number of name/value pairs
you can send before they get truncated.

Q1: Is there an internal PHP server-side page redirection mechanism
that would/could provide a more efficient mechanism for switching
between PHP pages?

Q2: Alternatively, is there a POST equivalent to header("Location:")
that I could use from within PHP to redirect between pages, so that
the number of name/value pairs I could send is unlimited?

CMS W/ Static Pages
I'm looking for an open source php CMS solution that will generate
static html pages.

PHP 4 W/ IIS 6 = Blank PHP Pages
I've installed PHP4 in isapi mode on Win2k3/IIS6. When I try to access a PHP page, it comes back blank. The odd part is that if I just a test page with phpinfo() in it, I get results.

I've tried everything and spent the last 2 hours googling for a solution. Any ideas on why this would be happening?

Redirection Of Pages In Php
First it check the text field, if the text field are not matched with your database values then after cliking the submit button it will show the error message in the same page , but if it matched then it will redirect to the specified page/link.

Generating Pages On The Fly
i have a db lthat i want to publish. it''s full of articles and i want it to work this way: there are ten categories (sex, health,....)once you click one of this category you go to a page where there are some articles (about sex, about health,...).

at this point is my problem. i'd like to find a way to click an article and have the code generating a new page for me with that article. is this possible?

to eplain:
this is sexuology.php with these:
article 1
article 2
article 3

once i click a new page is generated on the fly to let me read the whole article
how can i do.

Encrypting PHP Pages
I have a script that I made for my intranet that charges clients credit cards via authorize.net. In my script, I have to write the username and password in plain text. I do this with mysql connections in an external php file, but feel pretty uncomfortable doing this with the credit card processor just in case anyone gets a hold of the code. Is there a way to encrypt the password for the login without ever needing to display the plain text?

Search Pages
I am making an application that lets you upload pics to a server and also adds the directory to a DB. Now I just need to display the pics and I want to do it a page a picture. Kinda like a search page. AV or Google style. But instead of a link its a pic and then you can choose to go to the next one by clicking on a link. But the whole time it's one dynamic page pulling info off of a mySQL database.

Dynamic Pages
I am trying to create a page which will automaticlly change the size of
tables/graphics etc based on the screen resolution. Eg, if someone is using
a 800x600 the page layout will utilise this. If the same webpage is
diaplayed on a 1024x768 or 1280X1024 the cells are adjusted according. By
doing something like this could you make the logo change size by using a
percent size in a table cell or is there a better method than tables? If
anyone is able to help with tips or any examples (code or url reference) it
would be appreciated.

Also, what page layout is better to use.. eg.. html, php,asp, etc. The
site will be hosted on apache on a Linux Server.

My Wml/php Pages Are Too Large
Can wml and php pages that are too large be split between multiple pages? If so, how? My wml pages are too large.

Using Variables From Other Pages
Do you know how can use some variables I used in the last pages? I mean, In my first page I gave a variable some value that I used in the second one. Now that I change to a third one, I need that variable again. but if I try to print it there's nothing. How can I get it again? I don't have it saved in a table.

Crawling Web Pages
What I’d like to know is if there’s a feature in PHP that can read web pages, and index them.? I’d like to make a search feature for a forum, and have it crawl the forum pages and index certain words that I’ve specified (probably just nouns) and tally them up. The only thing really stopping me is the function to read the pages.

How To Get Object In Pages !
actually I am using php-java bridge to call some
functions of java from my php page. The value returned are encapsulated
in some object and data in that object are fetched from database. What
I want to do is that when I post my page to same page or other page I
again need that data (or object). I don't want to hit the database
again for same values. So how and where to set the object values. I
think I can set it in request object like in java we do
(request.setAttribute(String, Object)). I am focibly setting the values
like $_REQUEST['list']=somelistObject. But I am not getting the data
after submission of page. same operation with $_SESSION also is not
working. If somebody knows how to do this,

Creating WAP Pages With PHP
I am busy developing a site that will need to be accessed by both WAP and normal browsers. The normal browser access is OK and the site is finished for that - now comes to big problem:

I need to create content based on a MySQL database for use on WAP, my only means of accessing the MySQL db is using PHP from a Linux server. I've tried a test that is supposed to display Hi on the WAP browser. This does not work it gives me the following error: Unsupported content type: text/html

The code below is the original code I tried. After that I included Header("Content-type: text/wml"); with Content-type changing from text/wml to text/xml to xml to wml to xml/wml to no avail. Code:

Blank Pages
I have a web site that uses session variables and cookies. In-house and at
most clients the web sites functions great, exactly how it should behave.

However, at a few sites, the users will get the login page and as soon as
they submit, they get served a page with just the banner image on top and
blank underneath it. The page is two frames, top and bottom with the banner
image on the top. When viewing the source, the bottom page contains
<html></htmlonly. Looking at my PHP scripts, there are no scripts that
could generate that kind of a blank page, it would at least have a <headin
it.

So far what I've found that's different between the sites that work and the
one that doesn't is as follows.

The machine name is SQL1 with an IP address of 10.1.1.100. On this machine
is a web site set up in IIS with an IP address of 10.1.1.150. All of the
users at this site use a url of http://statuspage.cosite.com to get into the
site.

If you use a URL of http://SQL1/statuspage/userlogin.php - everything works
fine.
If you use a URL of http://10.1.1.100/statuspage/userlogin.php - everything
works fine.
If you use a URL of http://statuspage.cosite.com - They get the blank page
after the login page.

I'm thinking it has something to do with domains and cookies but I'm not
sure.

My cookies are set as:

setcookie("UserKey", $UK,$expiretime);

setcookie("PHPSESSID",$_COOKIE["PHPSESSID"],$expiretime);

$expiretime is a variable containing the expiration time of the cookie

Convert Htm Pages To Php
At present the client has a site constructed of htm pages. The pages now need to include a php script to be run at a particular point on them.

Do i have to convert all pages from .htm to .php? All htm pages at present are connected to a template. Converting them to php might disable the template connectivity. Is there a way to include the php script on the web pages and maintain template connectivity?

Importing Pages
I've written a content management system that I'm now selling to my
customers. It's very nice when we have a blank canvas of a site, but a pain
in the arse when there is already a site in place.

What I'm in the process of *trying* to put together is a script that would
do the following:

A simple form where you put the address of the site with the static pages

The script then spiders through the site, takes everything between <body>
and </body> and chucks the rest away

It would then take out all class definitions and all embedded styles like
font tags etc but leaves tables, <p> <H?> etc

This would leave a very plain page of HTML that would be inserted into a
database. CSS would control the fonts etc. I'm aware that there would need
to be some tidying up if there was any javascript or anything and also some
basic formatting.

What I want to know is

1. Has it been done and, if so, where might I find something like this
2. Might it have any commercial value to other developers?

Regarding 2, I'm thinking how much time something like this might save me if
I have to convert anything more than a few pages of static HTML into
something that I can put in a database.



Best Way To List Pages A - Z
I now have my emulator site up and running, no longer html but php! Even my vote script now works, thank for all your input. Now I want to have roms on my site for download, but it's a fair long list so you have to devide in sections a - z or something.

Can this be done in a way to create those pages with php/mysql instead of have to write html files for every emulator roms page from a to z? If anyone have done this before I would like to here what the possibilties are.

Multiple Pages
I am working on a php script that would allow members to post artices on the homepage. I think I have that pretty much down, what I don't know how to do is to limit the articles posted. I only want, say 10, to show up on the hompage, then users can click next page to see the next 10 articles. How would I do this? And how would I beable to make a next page link, too?

Also, this might be a bit much, but how would I make an administrator page, that allows me to authorize which articles are posted, and which are discarded? Just a simple one that says, post or delete. I can do the rest that would let me edit etc. but I just don't know where to start!

Error Pages
When a user clicks on a link on my page that points to a non-existing page
he will be redirected to error/404.php (by .htaccess)

How can I find the link that he was trying to follow, and the page on which
that link was.

If a user entered a non-existing url he will also be redirected but then
only the wrong url can be fetched. How can I do that?

Removing The .php From Pages
Hi i am new here we run a website called www.example.com and i was wondering if it is possible to remove the .php from the end of a address

For example www.example.com/newsinbrief.php, it would be nice it I could have it as www.example.com/newsinbrief

Is this possible does anyone know how to do it and if so where i could look for the code advise etc.


Copyright © 2005-08 www.BigResource.com, All rights reserved