Jump to content

PeggyBuckham

Members
  • Posts

    37
  • Joined

  • Last visited

Posts posted by PeggyBuckham

  1. The reason you get the result you do is that your date wasn't in single quotes so it took it to be 10 / 8 / 13 (ten divided by eight divided by thirteeen)

     

    lol ... Now that was a careless move wasn't it! Thanks so much!!

     

    I also have another field in the database that has the timestamp in it. I always put a timestamp on almost everything. I just wanted a column with the date in a string so that my client could read it when the data was output onto a spreadsheet.

     

    Thanks Again!

  2. I have a script that, along with other data, uploads a date into database. The date is generated using the date() function. 

    date('m/d/y'.time());

     

    What gets put into the data base is: 0.1098901098461

     

    If I echo out the date like this

    echo '<p>'.date('m/d/y'.time());.'</p>';

    then I get the correct results: 10/8/13

     

    Recently, after turning on php error messages on the server, I got an error (don't remember what it was exactly). I got rid of the error by putting this code in the header date_default_timezone_set('MST');

     

    I've never had to set the default timezone before and I've never had problems with the date() function, but I know that someone out there can help me.

     

     

     

  3. No I was not going to ask the client for a spread sheet, I was going to ask the old developer. So are you saying that I can use the same code to access a Microsoft Access Database as I do to access a MySQL database? I thought I had to use asp to access it?

  4. I am unfamiliar with Microsoft Access databases. I am redoing a site for a customer. The old site was written in .asp and on a Microsoft Access databases database. I was given ftp access to the old site and it appears that the database is in a folder on a file with a .mdb extension.

     

    I am used to MySQL databases that I can look at the contents of the database in a browser. Can you please tell me is that not possible with a Microsoft Access database. If I want the content of the database so that I can use it to repopulate the new database. Should I just ask for a spreadsheet of the database or is there another way.

  5. So i do not understant mail servers: POP3, SMTP etc.. I got the emails to work by taking out the html code. This is not a solution. It is a work around. For the moment I am going to let it go becouse I did not have any complecated emails to send out on this site.

    Thank You premiso, for your help! I am not going to mark this as solved, but I am going to move on to other work

  6. So I actually have to places where the code i wrote sends out an email. One of them already had the "from" from noreply@mysite.com. This morning I tested the sytem and it was working for both email. I had them sent to two diffrent email addresses each (4 emails). ...the system worked this morning, but it does not work now. I allso noticed that the emails being sent to my personal email were displaying the html code/tags. I am going to see what happens if I send out emails that are not htmls. This smight be a clue.

  7. I have a page on my website that sends out a simple html email.

    • This page worked a few days ago.
    • Then last night when I was showing my client, it worked, but the email did not display properly (html code was visible in the email).
    • Then today I can not get it to work at all.

    I have not changed my code, and I am using a script that I have used a lot of times. I'm not familiar with all the php settings on a server. I assume that one of these settings below are conflicting with each other.

     

     

    mail.add_x_header -- on

    mail.force_extra_parameters -- no value

    mail.log -- no value

    sendmail_from -- no value

    sendmail_path -- /usr/sbin/sendmail -t -i

    MAILTO -- root

     

    Also I had a similar problem a week ago. The email was not being sent out, then I played around with it, but did not actually change anything and it started to work again.

  8. Ok this works. It just seems like I took something that should have been simple and turned it into something complicated. i will leave this open for awhile in case someone has any suggestions on how i could have made it simpler. But this worked. I just added another array.

     

     

    <?php

    //-------------------------------------------------------------------------make variable out of Post value

    foreach ($_POST as $key => $value) {

    $$key = $value;

    }

     

    $c = 1;

    $example_array = array(

      $c++ => 'Blue',

      $c++ => 'Green',

      $c++ => 'Yellow',

    );

     

    $c = 1;

    $variable_array = array(

      $c++ => 'example_1',

      $c++ => 'example_2',

      $c++ => 'example_3',

    );

     

    //----------------------------------------------------------------------------this is part of a form

    for($i=1;$i<=count($example_array);$i++){

    echo '<p><input  style="width: 15px; margin:0" type="checkbox" name="example_'.$i.'" value="'.$example_array[$i].'"';

    if($$variable_array[$i]  == $example_array[$i]){

    echo ' checked="checked" ';

    }

    echo '/> '.$example_array[$i].'</p>';

    }

    ?>

     

  9. Ok this should make more sense. I have an array that contains the values of checkboxes. I have used the array as part of a form. each checkbox has a different name...I know that is unusual, but i want to put the value(s) into separate fields of a database. I'm trying to get the value of the variables; $example_1 , $example_2

    , $example_3.

    I am going to use this array later to read back the information that was submitted.

    I thought I was being clever so that in  the future it would be easy to add to or edit the checkbox values. But I overlooked the fact that I did not know how do get the values of $example_1 , $example_2 etc.

    I will keep playing with it for awhile. I'm sure there is an answer.

     

     

    <?php

    //-------------------------------------------------------------------------make variable out of Post value

    foreach ($_POST as $key => $value) {

    $$key = $value;

    }

     

     

    $c = 1;

    $example_array = array(

      $c++ => 'Blue',

      $c++ => 'Green',

      $c++ => 'Yellow',

    );

     

    //----------------------------------------------------------------------------this is part of a form

    for($i=1;$i<=count($example_array);$i++){

     

    echo '<p><input  style="width: 15px; margin:0" type="checkbox" name="example_'.$i.'" value="'.$example_array[$i].'"';

    if('example_'.$i  == $example_array[$i]){

    echo ' checked="checked" ';

    }

    echo '/> '.$example_array[$i].'</p>';

    }

    ?>

  10. I have post data that I want to get information about using an array...I  want to add the counter to a variable get the value...this example might make more sense. No this example does not work.

     

    for($i=1;$i<=count($example_array);$i++){

     

            if( $variable_name_.$i == $example_array[$i]){

            echo ' checked="checked" ';

    }

    }

     

    what i am trying to do is get the value for the variables:  $variable_name_1 , $variable_name_2 , $variable_name_3 ,  $variable_name_4 etc. Hope this makes sense!

  11. Thank You!!! I was a little desperate so I asked the question on a couple of other forums. Here is a little more inforation that might help out the next person

        * "a:4" says what follows will be an array with 4 elements

        * "i:0" says this is the 0th index in the array

        * "s:32" says what comes next is a string

        * "Green" is that string

        * the rest just follows this pattern

     

  12. I used a plugin to create the data in a database, now I am displaying the data and writing code to search/sort. My problem is that I am not familiar with arrays that are put into a single field in a database. I’m not even sure of the correct “name” for data in this format so I can find info about it and learn. So it anyone could please direct me to as tutorial or documentation about this. I would appreciate it. Here is a sample of the code contained in one field of the database.

     

    Ultimately I will need to display this data with a <br/> seperateing each element in the array. I also need to understand it better so I can search the fields that are displayed this way. I also really want to learn about it, because I believe it is fairly common and I should understand it  :)

     

    a:4:{i:0;s:32:"Green";i:1;s:26:"Red";i:2;s:31:"Blue";i:3;s:33:"Yellow";}

     

  13. I'm hoping someone has an answer for me becouse this is not working...yet...

    All I really need is to be able to get the emails that bounce to go to a specific email address.

    I would appreciate any help I can get. Thanks

    Here is my code:

     

    <?php

    $to = $email;

    $subject = "Confirmation Email";

    $headers  = 'MIME-Version: 1.0' . "\r\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

    $headers .= 'From:noreply@example.com'. "\r\n";

    $headers .= 'Return-Path: peggy@example.com'. "\r\n";

     

    $return_path = 'peggy@example.com';

    $message ='<html>

    <head>

    </head>

    <body>

    <table>

    <tr>

    <td>

    <p>my text</p>

    <img src="http://www.example.com/enews/images/photo.jpg" width="600" height="437" />

    </body>

    </html>';

    mail($to, $subject, $message, $headers, '-f ' . $return_path);

    ?>

     

  14. I have a form where the user puts in a email address. My client whats to make sure that the emails are valid emails. So after validating the format and the domain. I will send a email to the user. I want to check to see if this email bounces or not. I think that if I add

     

    $headers .= "Return-Path: me@example.com\r\n";

     

    to the header of the email then if it bounces  an email will be sent to me@example.com. There could end up being at least 50 bounces.  Is this the correct way to do this?? I have never used a Return-Path in the $headers before. It would be nice if I could put the email address that bounce into the database that the infor collected from the form goes.

  15. I have been working on using the setTimeout() function in javascript. The best I can think is I need to get the javascript to execute the php script. Right?

    Thank you for answering me I had almost given up thinking that someone would answer me? It has taken me way to long to try to figure out something that I thought should be easy.

×
×
  • 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.