dk4210
-
Posts
154 -
Joined
-
Last visited
Posts posted by dk4210
-
-
Hi guys,
I using the following code
if ($handle = opendir('temp_photo')) {
while (false !== ($file = readdir($handle))) {
$filelastmodified = filemtime($file);
if(($filelastmodified-time()) > 24*3600)
{
unlink($file);
}
}
closedir($handle);
}
I want it to look in the directory and remove all the files that are older than 24 hours old.
When I run the code I get the following error..
Warning: filemtime() [function.filemtime]: stat failed for image1.jpg
Warning: filemtime() [function.filemtime]: stat failed for image2.jpg
Warning: filemtime() [function.filemtime]: stat failed for image3.jpg
Warning: filemtime() [function.filemtime]: stat failed for image4.jpg
It seems to read the directory, but it doesn't remove them and I receive the error
message.
Any ideas of what may be going on or do you have a script that may resolve this issue?
Thanks, Dan
-
Thank you too micah1701
-
Perfect!!!Thanks for your help ken!
-
Hello guys,
I want to remove part of a string and convert it to a var instead of echoing it out.. How would I do it..
$string = "temp_photo/testing.jpg";
I want to remove temp_photo
so the out put should be
$filename2 = testing.jpg
Please advise..
Thanks, Dan
-
Hello Guys,
Does any one have any experience with Valums Ajax upload script?
http://valums.com/ajax-upload/
I want to be able to set the upload path but not sure where to add it.. It currently saves in the root directory.. I would like for it to save the uploaded files in the temp_images directory.
Here are the two files- upload.php (attached)
Here is the .js code - http://pastebin.com/pQDgXPvG
[attachment deleted by admin]
-
Hey did I mention that I also have a lot of experience with Joomla?
-
Hello There!
You have a project that you need some help with?
I have room for a couple new projects.. I am available and can answer the phone if you need me..I am a freelancer.
Let's do business
-
Do you need a photo gallery that you are your client can maintain (without using coppermine)? I have an application that I can intergrate within your site that is perfect for all your photo gallery needs.
I developed it to be super easy to use
Check out the demo (It's called Kelly Web Gallery)
http://www.kellywebserv.com/main/index2.php?content=demo
-
Need a web or PHP Developer? I'm your man.. Check out my site
No project to large or small
-
Site has been updated guys! Let me know if I can help you with anything..
-
-
We also specialize in Open source.. If you need a package installed and customized, please let us know...
-
Hello,
Do you have any development work that you need done? Contact us today! We have very competitive rates and we will exceed your expectations on your next development Project.
We specialize in Joomla and custom PHP development..
Please check out our site, and if we can help you with anything, please complete our quote form or drop us an email
Check out our portfolio -- http://www.kellywebserv.com/main/index2.php?content=portfolio
Thanks,
Dan Kelly
Kelly Web Services
dan@kellywebserv.com
-
Hey Guys,
What function can I use to replace numbers.. For example if I wanted to have php mailer email the credit card number say 111111111111 to the admin but I want to replace most of the numbers like this
**********1111 for example.. What function would I use?
Thanks, Dan
-
Did you get it to work No doze?
-
Hello Guys,
Could you take a look at my code and see if it is secure enough or if I need to modify it to be more secure?.This is how I call my pages. My link looks something like this http://www.mydomain.com/index.php?content=myscript
and it works great, but I am concerned about the sccurity.. Thanks in advance for your help. Dan
$file = (empty($_GET['content']) ? 'main' : $_GET['content']);
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '' . $file . '.php'))
{
include($file . '.php');
// print "ok"
}else
{
print "Page not available";
} -
Hey Toon..
I ran the php info script and the only thing I see is
sendmail_path has no value
Do you have any idea what it normally is on a windows server?
Would you mind checking it for me and see if you see anything else?
http://www.bellplantation.com/new/phpinfo.php -
Hello Guys,
I have a customer that has a windows 2003 server and has PHP 5 installed and working.. I have a php mail script uploaded, but when I fill it out and submit it. The email results never come to the email address that I have specified in the script.. How does one trouble shoot win machines when the email won't submit correctly. Here is my form...
<?php
// declare values
$contact_email = $_POST['EmailAddress'];
$contact_subject = $_POST['Subject'];
$contact_name = $_POST['FullName'];
$contact_message = $_POST['Message'];
$mydate = date ( 'l, F d Y g:i A',time()+240 );
// where to send e-mail to
$to = 'user@mydomain.com';
// e-mail subject
$subject = "Message submitted using Contact Us form";
// e-mail message
$message = "You have received a contact message:\r\n"
."----------------------------------------------------------------\r\n"
."Contact Name: $contact_name\r\n"
."Subject: $contact_subject\r\n"
."Submitted: $mydate\r\n"
."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."Message: $contact_message\r\n"
."Form Address: {$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
$headers = "From: $contact_name <$contact_email>\n"
."Reply-To: $contact_email\n"
."X-Mailer: PHP/".phpversion();
// check for validation, then send the e-mail
if(empty($contact_name) || empty($contact_email) || empty($contact_subject) || empty($contact_message)) {
echo '<p>Send us a message, enter your information below and click \'Submit\'!</p>
<form method="post" action="">
<table id="Form-Details">
<tbody>
<tr><td>Name:</td><td><input type="text" name="FullName" size="20" /></td>
<td>Subject:</td><td><input type="text" name="Subject" size="20" /></td></tr>
<tr><td>Email:</td><td colspan="3"><input type="text" name="EmailAddress" size="20" /></td></tr>
<tr><td colspan="4">Message:</td></tr>
<tr><td colspan="4"><textarea rows="6" name="Message" cols="47" class="input"></textarea></td></tr>
<tr><td colspan="4" class="right1"><input type="submit" value="Submit" /><input type="reset" value="Reset" /></td></tr>
</tbody>
</table>
</form>';
} elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $contact_email)) {
echo "<p>ERROR: Please enter a valid e-mail address.</p>";
} else {
mail( $to, $subject, $message, $headers );
echo "<h3>Message Sent!</h3><p>Dear $contact_name,<br /><br />We will get back to you as soon as possible using $contact_email.";
}
?>
-
Hey usually $_Get works for me
$cid = $_GET['cid'];
echo $cid
Works for me... -
Oh and must work with PHP 5
-
Hello Everyone,
I am looking for a free shopping cart that can easily be plugged into the framework of my site. I don't want oscommerce.. This is only going to be for about 20 products... I need an admin also.. What do you guys use for something like that? I am under a time crunch.. Any help would be appreciated..
Thanks, Dan -
Thanks guys I will try it..
-
Hello Everyone,
I have tried to duplicate the css font and font size that is on the following page[see linik] page, but I have been unable to. Could some one give me a sample css that would make my text look like this? Here is the link to the site.. Its the main text area.
http://keyetv.com/topstories/topstories_story_299113124.html
Thanks, Dan -
Hey Php Freaks (Eric and crew),
I want to personally thank you guys for such a wonderful site and the opportunity to get extra work through your site. I've actually received a ton of work as a result of posting my info on your site. I signed up and paid guru and haven't received a fraction of the work that I have got here.. I donated yesterday. I know it wasn't much but I plan on donating more when I get more jobs from this site. I think it's only fair. Keep up the good work and I will continue to be a faithful member..
Thanks, Dan
unlink files that are older than one day (24hrs)
in PHP Coding Help
Posted
Hi Adam,
I tried the code you gave me and it doesn't give me the error message but it also doesn't removes any of the files.. They're still there even though I run the script..
Any more ideas?