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




Deleting A Cookie That Was Made Before A Certain Date


I have changed the login code for a forum but imagine a lot of the users has a cookie already set. Is there some way I can see when I cookie was made and delete it if it is older than a specific date?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Cookie Not Deleting
login.php:
setcookie('id', $userinfo['id'], time()+60*60*24*31*3 , '/');

logout.php:
setcookie('id', '', time()-60*60*24*2);

Any idea why it is not deleting my cookie?

Problems Deleting A Cookie
I'm having great difficulty deleting a cookie in a script of mine. I have searched around the forum, but the solutions offered for deleting a cookie didn't do it for me. The point of the script is to automatically log users in when they visit the index page of the site. I set the cookie as follows in the login script:

Deleting A Field Value Based On Date?
How would I delete a field value in a mysql database every 24 hours? Anyone know?

Deleting Files In A Folder Modified Before Certain Date
I use a cache system that requires creation of files in a folder .

Now , what i need to know is how can i delete files created say 3 days ago.

So that the cache remains fresh.

The directory contains around 20,000 files , about 10,000 are generated each day (if they dont exist)

So getting info about the each file after using opendir will cause the server to slow down.

Cookie Expiry Date
is there a way to get the expiry date from a variable? I'm reading the value with the $cookiename that I set but I can't seem to display the expiry date.

PHP Cookie Date Time Stamp
How can I date stamp my cookie in php?

I've tried the getdate() function but that didn't work out too well.

Batch File Deleting And Folder Deleting
I have a folder in my web site where I used php to create and copy in files. but now I can't delete them easily. The only way I know how that is possible is through php. I get an error the following ftp error:

550 th: Permission denied
I had the chmod() set to 0777 on every file and folder. But I still seem to loss control over the files when I try and do things with them through other means.

I think it is because the user I use to access the files via ftp a diffrent user. So I tryed to add a function with chown() for the new files I was posting and uploading. It didn't work on those new files. so it looks like the only thing I can do is use the unlink() function which deletes the files fine.

The only problem is now I have something like 100 sub directories all with files in them. I need to figure out a way to batch delete them. I can't find a script that goes through and finds all file contents including all sub directories and unlink those things.

I found some that will use a for loop to list out the contents of a folder but it is just files. No sub directories. Any body got any ideas on which functions I should use or know where a script is that I can base mine off of.

I am not sure how to approach this since what I tryed with chown and chmod has failed thus far. I currently have no code and am starting from scratch on this batch flushing of my directory.

I Had Problem With Cms Made Simple Can Anybody Help Me?
May i know how to include cmsms to my site?
For example
site:www.example.com
content:e-commerce site.
problems
1.how to connect my site to the cmsms?
2. how to connect to mysql tables ,and how it automatically fetch the
data from the userdetails and category details and all these ?
3.is there any site domain which will help me to understand better?
4.how is the user interactivity with the mysql database.
5.where to remove the install directory?
because i tried to remake a site wich having the dbname shop so i
finished the instalation but i got thid warning
Warning: install directory still exists.

Sessions Made Personal
I am just building a site for someone and i was wondering how can we make a session personal so when someone looks in their previous sessions in their browse they will be able to see Arabian Airlines rather than PHPSESSION? Below is the code i currently use to create the session. Code:

Process Array Made With Chcekboxes
I don't know why I can't get this to work

I have a form with a number of checkboxes on one page
<input type=checkbox name="listing" value=$ID>

I then want to process only the listings that were checked, so: (I tried to use a while and a foreach, neither worked)

A Good Pre-made Subscription System.
I need to track down a free and simple system to allow our users to purchase a content subscription to our site, but need a simple way for them to do so in real time with their credit card.

Any recommendations? I just think there has to be a good PHP/MySQL package out there I can use.

PHP-MySQL: Returning ID When New Record Is Made?
Let's say I create a new record in a table like this:
mysql_query("INSERT INTO table (col1) VALUES ('example')",$conn);

....that had an auto-incrementing, unique identifying column named "ID"
that would be populated with a unique number upon insertion...

How can I get the unique number it assigned to that record returned for
futher use?

Ready-Made Website Tools?
In the same way that you no longer need to write your own shopping
carts, Id like to not write other common PHP features of websites.

Specifically I am looking for an open source user management package
(registration, login, account management) with a nice clean interface
that I can just drop into my website. I figure this would be
preferable to writing it myself as it will be better tested and more
secure.

In general I am looking for pointers to collections of PHP tools that
we can just drop in to our websites to perform common functions.

System(); Not Working Within A Made Function
for some reason system(); isnt working when i use it within a function i made, is there a reason? it works perfectly fine out of the function.

Creating An If Statment Made Out Of Variables.
What I am trying to do is create an if statement that is made out of purely variables, but I am having trouble getting it to work properly. Code:

Ready-made Function For Ordinal Output: 1st 2nd 3rd 4th...?
Is there a ready-made function for outputing a variable in the form
1st
2nd
3rd
4th
etc.
by detecting if the integer is a 1, 2, 3 etc Not that it would be terribly hard to write, but if it already exists...

Any Ready Made CMS Package That Can Integrate Into Mainpage?
any ready made CMS package that can integrate into mainpage? eg. user can edit the mainpage content with several category themself without need the programmer edit the source code.

Autopopulating Drop Down Not Saving Unless A Selection Is Made
I have a form that autopopulates and allows user to make changes where necessary. In this form are some drop down menus (hardcoded on the page). All the selections (50 states for example) are there. If I select a state it will then post to the database. If I don't select a state and just leave it as the previously selected state (not change the selection already made by a user) it puts a blank in the database.

Examples:
The <?="$rest_state_pr"?> will pull the state the user selected previously. If I change the slelection it saves the new selection, but if I leave it as the "default" It puts a blank in the database. Code:

Sort Search Results - Query Made From Form Variables
I have created a search engine with multiple search fields, the results.php page shows the results.
My question is, how can I allow the user to sort the results (name, description, price etc), simply by clicking on the column title. This wouldn't be a problem if the SELECT query was constant - just add a $var at the end where ORDER BY should be, but how can I do this when the SELECT statement is made up of $_POST VARS? Surely if I reload the page with the sort command, it will have forgotten the $_POST vars that made up the query?
I have searched EVERYWHERE for help on this PHP Code:

Check Date From Input Must Greater Or Equal Today Date?
I have 3 select box. Code:

<select name="day">
<option value="1">1</option>
<option value="2">2</option>
.......
<option value="31">31</option>
</select>

<select name="month">
<option value="01"> Jan </option>
<option value="02"> Feb </option>
.....
</select>

<select name="year">
<option value="2002">2002 </option>
<option value="2003">2003</option>
</select>

When I select and click submit in form. I will have 3 variable :

$day, $month and $year

How can I check the day that I choose in form must equal or greater than today date? If it less than today date. I must print error message to user.

Date Is Not Being Pulled From MYSQL Database, Instead Current Date Is Displayed!
I am having trouble pulling a date from a database using PHP at the <a
href="http://www.mytuneslive.com/ameshkin69/"> following page.</a>

Here is the code. As you can see, it is just making the date the
current time. The values in the database are UNIX timestamp, and the
DATE() function is used to convert from UNIX to readable date. Can

<td width="55%" align="left" valign="top"><?php
$row_comment['timestamp'] = date("n d Y g:i A");.....

Deleting
how could i delete everything from a table in a mysql db except for the 10 latest things ?

Read Today's Date Print Tomorrow's Date
I've got a small script that writes a random number and the date to a text file. Then the script opens this text file and if date = date from this text file something must happen.
If something happened this script must open this text file again and replace it with a new random number and tomorrow's date.

<?php

$date = date("d-m-Y");
mt_srand((double)microtime()*10000000000);
$num=mt_rand(0, 20);
if ($num == $num && $date == "$tomorrowdate") { echo"$num -- $date";}
else
echo " ";?>

So if the script gets activated on the 05-05-2003 it must write tomorrow's date into the text file (06-05-2003). How will I get tomorrow's date today?

Help: Date Function Not Returning Correct Date & Time
I have just notices that the date() function is not returning the correct
date/time on my "server".

I am running apache2 on my winxp pro laptop.

My system clock is set to the correct date, time and timezone, get the
results returned by date() are 11 hours behind.

PHP Date Question: How To Determine The Date Each Of The Past 3 Sundays
How can I determine what the date was (in YYYY-MM-DD format) last
Sunday, and the Sunday before that?

For example:

Today is Thursday, August 18, 2004 (2004-08-18). I would like to have
the following variables:

$this_past_sunday = 2004-08-14
$two_sundays_ago = 2004-08-07
$three_sundays_ago = 2004-07-31

etc. etc.

Save Date To Table Field Date Type
I have a calendar picker on a form that fills a text box with  XX/XX/XXXX  date format. If I run a insert statement  the date field in the database shows 0000-00-00. If i change the field type to varchar  the correct format displays. 

What is the correct way to save a date to a mysql database?  Furthermore to query on the date  how about a select * from db_name where servicedate >= $startdate  and  servicedate >= $enddate  I supose this will not work
Any pointers?

Deleting All Files
Is it possible to delete all files in a folder using unlink() or something similar?

Deleting The Saved Db The One Before?
I made a script that backups the database as sql file in the server. I mean script writes it into the harddrive, but everytime when i execute the script the harddrive loss another 3 mb. How can i modify the script to delete the one before when i execute it to write the new one?

Need Help With Deleting Records
I'm trying to add a link on the display of a record to delete that record.

The main part of the record is stored in pw_event, then there are several rating fields for that record stored in pw_rate, and there is also several records for the first record stored in pw_whois.

I need to have a link that will deleted everything for that record in all three tables.

Here is my display script:

PHP Code:

Deleting Last Comma
The code below displays pet names like so:

Fido, Bowser, Kittycat, Spot,

and I want to delete only the last comma. I tried 'substr' and 'rtrim' and both of those delete the space and comma between each name, not just the last name as I'd like, so I end up with:
Fido,Bowser,Kittycat,Spot,

How would I delete only the last comma, so that it is this instead?
Fido, Bowser, Kittycat, Spot

Even with trim and substr, I end up with:

Deleting A Session
I want to be able to delete a session so that the next time there's a call to session_start, it creates a new session ID. I don't want to destroy the session variables specifically (though this will be a side-effect of what I'm doing) so I know that session_destroy isn't what I want to do.

I presume I should just delete the session cookie manually. Is there a neater way? And if not, how do I do this?

Deleting A Director
I'm using this code trying to make ato delete a file or folder under w2k, apache.

$direct=split("repadmin.php",$PATH_TRANSLATED);
$file=$direct[0].$filedeleted;
$filesys = eregi_replace("/","",$file);
$delete = @chmod ($filesys, 0775);
unlink("$delete");
header("Location:repadmin.php");
exit;

but return this warning:

Warning: unlink(1) [function.unlink]: No such file or directory in c:program filesapache groupapachehtdocsguonline epositorio epadmin.php on line 94

I checked the whole path and looks good.

Deleting Files
The below should delete files from a dir older than a week. I set the $dtime to 0 to test the script but it deletes nothing. What is wrong? Code:

Deleting Files
I'm using different files to store some arrays to make administration of a very small job-logger very easy. I currently read the file, remove the element to be deleted, delete the whole file, and write the file again without that element. Is there a way to remove a single element out of that file without deleting the whole file?

Deleting Cookies?
For some reason is i set my cookies like this PHP Code:

Deleting A Line
how do i delete from a text file 1 of the following lines

jon|scott
adam|smith <--delete
paul|clark

say i would like to delete the middle line of this txt, in member.txt
what php code or logic would help me accomplish this?

Also i am clicking on a hyperlink that is keeping count of the entries
i have
made. e.g php?record_id =1
php?record_id =2

Deleting A Record.
One last (hopefullly) problem I can't seem to get around for this
program...why isn't this deleting the row i want? It does nothing. Now error
messages either. HELP!

$link = mysql_connect("localhost");
if(! $link)
die("Could not connect to MySQL");

$database = "PC_Store";
mysql_select_db($database)
or die ("could not open $database: ".mysql_error() );

$result = mysql_query("DELETE FROM inventorydata VALUES('$ProductID')");

The $ProductID variable is brought in from a menu choice on a diffrent page,
it is also the primary of the table...so it should delete the whole row
right?

Deleting Records
I've been trying to delete records since a week and i'm not able to do it. Before with this script, i was doing so many things at a time and i was confused.But, now, i just displaying the records from a table N trying to delete them.Would somebody pls guide me.

I just wanna set the delete flag(i.e, i want to set the RBS_DELETE column to Y or something) when i check a check box to delete it. I've some 5 records displaying on my form and i want to check 3 of them and when i check them and hit submit, i want the RBS_DELETE column to have some value. PHP Code:

Deleting A Row From A Database
I can't fiqure out why my delete function isn't working. I have a listing of rows in my database with an option to delete an individual row at the end: Code:

Deleting A Message
I want a button to delete each message in you inbox wen clicked. im using this that doesn't work, because i coded it Code:

Deleting Posts
How can I delete my previous post?  It's showing up in Google when I search for the url referenced in my previous post (if I put the name here, it will show this post, too).  If I can't delete it, can I make it so that Google can't pick it up?

Deleting Files
I'm trying to modify this script to remove files that end with %enlarged.jpg or %enlarged.gif or %enlarged.png, can someone help with the if statement, I've tried several things, of which, nothing is working: Code:

Deleting Folder
is there anyway of deleteing a folder and deleting all of its contents with it?
i know that with rm_dir needs to folder to be emptied

Deleting The Pages!!!
I wanted the php files in my computer to be protected.If someone copies them and use in different machines,how can the php code find that the code is running in nextmachine. Is there any idea,that I delete the files using the unlink() method,when they are stored/run in next machine.

Deleting Using Checkboxes
im wanting to delete multiple things from a database using checkboxes, now i know how to use checkboxes in php etc. my question is would this be done using a basic while loop? i mean would i query all the things and then do

while ($check_box == 'ON')
{
do the delete script
}

or is there something more to it?

Deleting A Line From.txt
it writes the line or lines to be deleted correctly into issues_deleted.txt which is line fwrite($file_contents_deleted, $value);

and when it refreshes the line still exists in banip.txt it does echo out the line as well just doesnt remove it from banip.txt anyone know why? Code:

Deleting From Sql Database
I have used this script I made to delete files from a server and simultaneously remove information about the file from a database. I have uploaded the same script to a new website and it no longer works. The file does get deleted but the database line doesn't get removed. I can tell where it's going wrong by the error custom error message 'echo'ed on the page ("your file was only partially uploaded"), but I really don't know why.

Deleting Files
I have some script that takes an album id and deletes that album and the specific photos in that album. The code does run. The problem is that an error message i set to echo appears saying error deleting photo once the page automatically refreshes. When i check the image folder the images actually have been deleted. Code:

Deleting Elements From Arrays
I'm trying to delete empty elements (elements that contain empty strings) from the array with unset() function by looping through the array.


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