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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Auto Delete


This script was meant to delete a file after X days...in this case I wanted it to delete files that were older than 1 day except .htaccess. what the script is doing is deleting everything in the specified folders except htaccess even though the files are less than a day old. any suggestions? Code:




View Complete Forum Thread with Replies

Related Forum Messages:
How To Auto Delete Table Row?
I Have A Page On My Site That The Database Outputs To. There Is A User That I Dont Want To Ban Yet , But I Do Want To Block Or auto Delete His Data. Now When Everyone Post New Data The Only Table That Would identify Them Is The Username Table, There Is No Member ID Table.

Now I Would Like To querry The Database And Auto Delete Table (Username) BOBBY And The Row BOBBY Posted , So There Is No Data Output To My Site Page For BOBBY. Can Someone Give Me A Couple Codes To Try, And I Would Think The Code Would Need To Be On A New Page That I Need To Make Up Right?

View Replies !
Database Auto Count What About Delete?
I have a table that give a unique ID to certain Articles.
To give the ID i simply use the Auto count of the DB.

But what happens when i delete a record? i am now missing an ID.
How can i insert a row and give it the first available number?

For example ID 1, 2, 4, 5, 6

i would Insert and set the ID number to 3.

View Replies !
Auto Delete Date Based Calendar Events
Out of both wanting to improve my PHP skills and necessity, I created my own small CMS for a non-profit site I am involved with. One of the features I have is an event calendar where other users can submit  events, which then go into a "holding tank" until I can approve or deleted them. It's working great and everyone is loving it... but I have discovered one issue. When the date of the event passes, I have to log into the admin area and manually remove it. I am actually not deleting it from the database but changing a field variable and archiving it for our records.

I have been trying the past few days to come up with the necessary PHP to automatically check the current date (today's date) against all the calendar events and remove ones that have already happened. I could then hook this up to a CHRON action in my hosting CPanel and call it a day - at least that is how it all plays out in my head. 

I imagine in order to point me in the right direction you will need some information about my database.

View Replies !
Auto Delete Record/Send Email After X Hours
What I have is a MySQL database which stores records that each have a date stamp on them (2 of them - one for record created date and one for record last updated date), what I want to do is try and have it so that records that haven't been updated in say 72 hours are automatically removed from the database, or the record is updated to set a flag as being out of date, or an email is sent to alert a user of the out of date record etc.

I can easily write the script with the SQL query to check the records by the datestamp and perform the actions needed if the records are out of date, however that requires someone to physically visit that page to run the script and clean up the out dated records. What I want to try and do is have this happen automatically on its own without someone needing to actually visit the page to run the script.

A good example is on eBay how emails are sent to you to let you know when your auctions are about to expire, i wouldnt imagine that eBay would rely on people visiting their website to make those queries run on the database so there must be a way of doing some automated script executio or having a scheduled task run on the server to have a PHP script run each day at midnight or something? Anyone know how to do this?

View Replies !
Auto Delete The Old Records But What If Server Clock Was Set Up Wrong In Maintenance?
I want auto delete any events that the event date is at least 1 day older than current date. No problem for the php programming. get the current data (server clock), check the events date and delete the old records. My problem is that for some very rare cases.

Say if for extrem cases I have 1000 new events saved in database. But somehow, I or the the hosting company do the server maintenance, and reset the time clock of the server, in case in the maintenace, the server time clock was set up wrong say 2005, was set up as 2006. Code:

View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

<?
include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

View Replies !
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ?

$query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt  WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error());
im just getting "Unknown table 'notes' in MULTI DELETE" ?

View Replies !
Auto-Tab
I have a page that has 5 input boxes, the first box holds 5 characters, the second holds 4 and carries on varying in length. I need to find a way so that when a user enters the 5th char in the first box, then the cursor moves to the second box and so on...

View Replies !
Auto Variable
Say I have fetched these from my mysql database:

13
14
23
39
80

How do I make them assigned into an automatic variable?

View Replies !
Forms In PHP With Auto Tab
anyone knows how to achieve a form with at least 12 input fields that need an automatic tab since the application uses bar code reader?

View Replies !
Auto Calculations
I've seen on a few sites that in a shopping enviroment if you choose a price from a drop down and then maybe a delivery ares, the actual price shown for the product is updated instantly without page refresh.

View Replies !
Auto Run A 2nd Script ?
I have 2 scripts, After the 1st script is run/activated, i'll like it to automatically forward the result (POST) to the 2nd script ....

View Replies !
Auto Increment By More Than 1
I have a table that I want to automatically generate an account number. I previously developed a simple database using appleworks that allows one to enter the amount she needs to add to the ID field with each new record. MySQL does not allow for this so I figure I must add it to the PHP script. PHP Code:

View Replies !
What Will The Next Auto Increment Be?
I have a MYSQL table with a field that auto increments 'ID'. I need to know what the next ID will be. Is there a simple way to do this?

One solution I've thought of is to query all the records and sort it by ID, and then just take the last record +1. But that seems awfully inefficient. Does anybody have any other suggestions or know of any functions that will do this?

View Replies !
Auto Number
How to generate auto number for php? For example, every time I submit the details to another page, the number will add from 10001 to 10002.

View Replies !
Auto Backup
how will i take auto backup mysql database table data after 6 hours daily? i know that this is very easy to take backup database table or full database manualy by using mysql dump syntax but i need to take it autometicaly daily after 6 hours.

View Replies !
Auto Php Upload
Senario A:

I've a form actually .csv, when a user finished filling out the form,after that when user click save button auto upload the file .csv file from server A where original .csv file(testing server) to server B (life server).

Senario B:

Same concept but when user click save button,the save button disable and button upload will appear but cannot browser and it is possible to put value in input type="file"??? The reason don;t want user to have capability to browse server A(testing server).

View Replies !
Auto Load
I am tring to figure out how to do something. I am starting to build a collection of coomon used php class, kind of a framework but not really, that i will be using for all my site.  For instance i have a database class that handle all mysql database stuff.  I have a site class that handles html stuff(generating header/footer, form elements, etc..,

i just have all these classes included in 1 folder but it is starting get big and i would like to be able to start searating them with folders. the problem is how can i tell the auto load where the class is without changing the name of the class?

View Replies !
Auto Session_start();
Is there a way without code <?php session_start();?> ontop of each page to get that affect?

View Replies !
PHP Auto Counter
I want to be able to make a list of number in a colum that changes when a line is added to the middle of it. I have looked for it but cant find anything about it.
I will put an axample to explain myself better.

 #  |   |   |   |   |
------------------
 1  | a | a | a | a |
 2  | h | h | h | h |
 3  | n | n | n | n |
 4  | z | z | z | z |

Now i want to add a c value between  a and h

 #  |   |   |   |   |
------------------
 1  | a | a | a | a |
 2  | h | h | h | h |
                            <----------  3  | c | c | c | c |   I want it to get number 3  automatically and that the rest of the numbers rols one forward.
 3  | n | n | n | n |
 4  | z | z | z | z |

View Replies !
Auto Linebreaks?
Is there a certain way to 'auto-magically' add line breaks when enter is pressed?

That way, you don't need to say something like..

This is a message.<br /><br />

Messages are fun!
Normally, if you type...

This is a message.

Messages are fun!
It would turn out like this.

This is a message. Messages are fun!

View Replies !
Getting Last Id Of The Auto-increment Key
I have two tables and I need to get the last id of the primary key in one of the tables. I did some searching and found a solution that works.

$sql=mysql_query("INSERT INTO (table) (column) VALUES ('test')") or die (mysql_error());
$insert_id=mysql_insert_id();
$num = $insert_id + 1;   //need to increase the last id by one to match new entry in other table

This works well. The downside is in order for this to work an actual value is filed into a new row of (table) after the last id found in (column) thus giving me a blank row. While this isn't too bad, I could imagine I'll end up with a bunch of empty rows in my table. Is there a way to prevent this from happening -- i.e., a bunch of empty rows?

View Replies !
Auto Run Scripts
This is probably a real simple thing to do but I have never done it before!

I have an apache server on my server (XAMPP) running PHP and I want to be able to programme it to run a php script at certain times.  Is this a server or PHP task and how would it be done?

View Replies !
Getting An Auto-increment Id?
When someone creates a topic, the following is executed:

$sql = mysql_query("INSERT INTO `reflexproj`.`topics` (`topic_name`, `topic_desc`, `poster`, `forumid`) VALUES ('". $posttitle ."', '". $desc ."', '". $sessionu ."', '". $forum ."');");

This inserts the topic into the topic table. However, then this is executed:

$sql = mysql_query("INSERT INTO `reflexproj`.`posts` (`poster`, `post`, `topicid`) VALUES ('". $sessionu ."', '". $fp ."' '". $id ."');");

This is meant to insert a post into the posts table that starts the topic. However, this is a problem. The problem is, that $id hasn't been defined.

My question is this, really: How do I get $id? Basically, I've got to find a way of getting an auto_increment value from a database. Anyone any ideas?

View Replies !
Auto Linking
i'm tryin go to do a auto link thing and i'm running into some problems with my mysql statements

$sql_query = "SELECT * FROM tags";
$result = mysql_query($sql_query) or die(mysql_error());
$result = mysql_fetch_assoc($result);

foreach($result as $res){
$res["tag"] = $tag;
$res["link"] = $link;
}
echo "Test".$tag;

$keyword_array = array(
$tag => $link,
);

View Replies !
How Can I Auto-save The .pdf?
i've gotten used to using the ezPDF class to create and stream a pdf.  Now i've encountered a project where I want the created pdf to be emailed rather than streamed to the browser. 

I'm comfortable enough with phpmailer to send the file if I can only figure out how to save the PDF.  The documentation for the ezPDF class mentions a function called ezOutput... but that seems to do the same thing as ezStream.

View Replies !
Auto Upload
i wanna know whether possible to do this :

Senario A:

I've a form actually .csv, when a user finished filling out the form,after that when user click save button auto upload the file .csv file from server A where original .csv file(testing server) to server B (life server).

Senario B:

Same concept but when user click save button,the save button disable and button upload will appear but cannot browser and it is possible to put value in input type="file"?The reason don;t want user to have capability to browse server A(testing server).

View Replies !
Auto PHP Downloader
I'm trying to figure out if anyone has this available and if not how difficult of a script is it to write? I am by no means a PHP programmer but I hear this is probably the easiest most effecient way to solve my problem.

Basically i need a script that will allow me to automatically download a specific file type(s) from a web directory and save it on to a local PC directory. I guess it can have a check interval to check for new files every couple of hours or so. Can anyone help or point me in the right direction.

View Replies !
Auto Downloads
from what I can tell you can use header statements to trigger downloads when a page is loaded. Is there a list somewhere of the content types? Or is there a better way to trigger a download?

View Replies !
Auto Responders
Trying to setup an autoresponder, so that even when I'm not available to answer emails, the sender still receives an email to say something like 'you're email will be answered as soon as possible.' The same should happen if they send a form enquiry.

The autoresponder should also contain their email or form with an extra bit from us. Is there a way of doing this for free? The hosts do have autoresponders, but they are not able to handle this.

View Replies !
AUTO Mailer
if anyone knows a good Auto mailer code. i just need a code so when i go to the webpage it will send all the e-mails, i dont need anything extra. i got a list of emails in my database, and i need to send emails to everyone at once. i got 3000+ emails.. so yea, it needs to be auto.

View Replies !
Auto Look Up Of Pdf Files In Dir
I'm a newbe to web development, using frontpage as tool. I need to be able to look up a construction detail that is a PDF file in a detail dircetory on server. We have an intranet that our people in the field log onto and look up these details. I would like to have a search box on a form that would open this PDF when it is type and button pushed to search.

The file structures are STD-DET-0000 thru 0999.

View Replies !
Use To Add Auto Increment
I'm using LOAD DATA INFILE to populate a MySQL db table with values from a textfile. The textfile does not have an empty column I can use to add auto increment. Is there a way to add auto increment without editing the textfile or going back into my table and adding an extra filed for the auto increment after the table has been updated?

View Replies !
Auto Detect CLI
How can I detect in php that I am running from CLI (command line), and
not the browser. I hate to put a constant in each script:
e.g. define(’CLI’, 1)... Code:

View Replies !
Auto-increment Value
I had failed to realize that when using auto-increment on the Primary Key field I didn't need to enter a value in that field as I populated my database manually one row at a time. Subsequently, using phpMyadmin, I deleted rows and added rows and in between I un-set and reset the auto-increment function on the Primary Key field. I also Indexed and then Unindexed that same field. Now I have this value showing in the Indexes grid of phpMyadmin:

Keyname: Primary, Type: Primary, Cardinality 23

But, when I add a new row, the value comes up as not 24 (as it should be) but 29. Also, if I leave the value of the Primary Key blank (which is the correct method) but fill in the other values for the row and click Add Row and Return to the table row display page, I get 2 blank rows, with the value of the Primary Key field +5 of where it ought to be.
Is there a way to reset the auto-increment value?

View Replies !
Auto $_GET['var'] To $var
How can I dump all $_GET varaibles and their value? - for debug.(submitted from a form). Allso - Is there a way to automatic extract/set all $_GET['var'] submitted from a form? I want e.g. $_GET['var'] to be converted to $var without having to type $var = $_GET['var'];

View Replies !
Auto Refresh
I have a select menu created. When the user makes a selection I want to perform a Database Query based on the users selection.

How do I do this? That is how do I get the page to make the database call once select menu used?

View Replies !
Auto Linking With PHP
I have a bunch of articles with plain text url's. I'll be plugging them INTO phplates and rather than type in the a href= yada yada, I'd like to use php to automatically convert those url's clickable hyperlinks whenever someone visits the page. Can that be done with the following function? Of so, how the heck do I get it to work on my pages?

<?php

function make_clickable($text) {
$ret = " " . $text;
$ret = preg_replace("#([
])([a-z]+?)://([^, <>{}

]+)#i", "1<a href="2://3" target="_blank">2://3</a>", $ret);
$ret = preg_replace("#([
])www.([a-z0-9-]+).([a-z0-9-.~]+)((?:/[^,<

]*)?)#i", "1<a href="http://www.2.34" target="_blank">www.2.34</a>", $ret);
$ret = substr($ret, 1);
return $ret;

View Replies !
Auto-Complete
I'm just curious why Dreamweaver and most Text / HTML editors default to "auto-complete", where you hit a "<" and the other half is provided for you.

For me, all that means is I have to reach out away from the home keys to hit the "end" key or the right-arrow to get to the end of the line before hitting enter. I'd rather hit the ">", it's closer and quicker.

Does anyone find that "auto-complete" handy.

View Replies !
MYSQL Auto Inc
One of the PHP/MYSQL sites I've built uses a child_id / parent_id system for categories.
So, to put the category 'goats' (child_id=20) in the category 'animals' (child_id=2), I assign to category 'goats' parent_id=2. This system works perfectly. I recently added a page to the database that I didn't want to sit within any categories, so I manually assigned this page a parent_id=999 (the highest child_id at this point was 270).

Since I did that, a couple of new categories have been added by the owner of the site (using content management tools) and but rather than continue from 270 for their child_ids, these new categories started from child_id = 1000, and then 1001. the child_id field was set to 'unique' and 'auto increment' in MYSQL, but having turned unique off, and then back on again, I've not been able to re-create the child_ids being bumped up in this way, e.g.

I changed the parent_id from 999 to 9999 and experimented with adding new categories, they followed on from the last entry at 1002, 1003 and so this time ignored the 9999 in the parent_id field. As detailed turning unique off and on had no effect.

View Replies !
Auto Increment
The id collumn is setup for auto increment however how do I modify the following code to achieve this?

insert into
vhc_items(id, cid, name, time, pic, description, link, hidden, filter, clicks, weekclicks, clickslog, pin, starttime, endtime)
values ('9999999', '1', '".addslashes($title)."', '1189875417','" . addslashes($md5) . ".png', '" . addslashes($descr) . "' ,'" . addslashes($md5) . ".flv','0', '0', '0', '0', '4|0|0|0|0|0|0|1189983109', '0', '0', '0')

View Replies !
Auto-install
I was preparing a final version of my CMS the PHP5 one is ready. Still need to put together a PHP4 version (easy modif)

It is 45 MG and contains 58 folders, 810 files.
works in IE and FF

I would like getting the “execâ€&#65533; knowledge
I mean from a ZIP how one does create the autoexec that looks for existing setup and then auto-install, create DB etc...
Plus I need to find if the PHP on server will be 4 or 5.

Any place I should look for to clarify that process in my mind?

What should be the thread of process?

View Replies !
Auto Drop Down Box
I am trying to create 2 drop down boxes, for example Country and state so when country is selected it will show in the second drop down box the correct list of states. I know how to do it with an if command in the second box but it requires a form to be submit but because it is already a form, how would I make a form inside a form work?

View Replies !
Auto Updates
I am going to add some new features to my flash based games site, where every day, the best games of the day are shown as the "best daily games" I want to be able to update this automatically everyday after 12am, how would I go about this? Would I check the time on every user that visits and then update accordingly?

View Replies !
Auto-Run Scripts
I have a few scripts which I am running using cron_jobs. Currently I am on a windows server... but how can I modify the permissions so that nobody can access the files through a browser...?

I want it so that it can only be access by the server. Whats the best way to do this? Should I modify the permissions or can I use the same type of code that I am using to check whether a file is included or ran as stand-alone?

View Replies !
Auto Numbering
I made a form processor which lets me accept or reject a person who signed up from a different form. Now, when i accept one person, he/she is deleted for that table and moved to another. The second person to sign up should have changed its user id to 1, but it stays the same....

View Replies !
Auto Download
i have a folder (foo/) that changes often, and i want a user to be able to download foo.zip which is generated at that time. right now i have it overwrite the existing foo. zip file: is there a way to make it so the file is not saved. as in it is created just to send to the user but doesn't actually stay on the server.

View Replies !
Auto Updating
I don't really know how to describe this, but I have two form fields where one is dependent on the other and needs to change if the user selects something from the first field. I'm just trying to allow for a date selection. I have two drop down menus, month and day, and since the number of days in a month depends on the month, I need the drop down day menu to only list days in the month that is selected. What I want to do is have the drop down day menu change whenever the user picks a month. Kind of like what happens on Nvidia's Driver Select page, only with a drop down menu instead of a list or whatever you would call that. I tried looking at the source code there but couldn't really make much out of it.

View Replies !
Auto E-mail
I searched through the forum and couldn't find anything like what I need to do. This is for a site that has music shows on it so everytime a show is happening that day I want it to send an e-mail with a link to that show in it from the e-mail addresses I have in a db. But I have no idea how to have a script that isn't drive by a form send these e-mails.

View Replies !
Auto Select
PHP Code:

// 1) Get all Investment Types
$query = "SELECT investment_type_ID, investment_type, inv_note, inv_note2 ".
           "FROM investment_type";
$result = mssql_query($query) or die('Select Error');

View Replies !
Auto Executing PHP Code
Right now i am on a matrimonial site. i wanna do an auto match finder. ie; there may be many registrations in the site. i wanna findout all those matched profiles on a daily basis, say by 12 midnight each day. i wanna get that list as a mail even if i didn't checked the admin screens. ie; the script should execute on 12 midnight each day automatically. is there any way. can i do it using PHP.

View Replies !
Get Last Auto-increment Number
I am inserting related data into 2 tables. The first table I insert into has an auto-incremented field. The second table i insert into has a field which needs to hold the same number as the number in the auto-increment field from the first table. I cannot auto-increment the field in the second table because the number will occur more than once in the second table.

How can I retrieve this auto-incremented number from the first table?

View Replies !

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