Jump to content

dk4210

Members
  • Posts

    154
  • Joined

  • Last visited

Posts posted by dk4210

  1. 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

  2. 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

     

     

  3. 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]

  4. 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

     

    http://www.kellywebserv.com

     

    Check out our portfolio -- http://www.kellywebserv.com/main/index2.php?content=portfolio

     

    Thanks,

    Dan Kelly

    Kelly Web Services

    dan@kellywebserv.com

    http://www.kellywebserv.com

     

  5. 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

  6. 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";
    }
  7. 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.";
    }
    ?>
  8. 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
  9. 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
  10. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.