Jump to content

rscott7706

Members
  • Posts

    88
  • Joined

  • Last visited

Posts posted by rscott7706

  1. I have searched extensively for any existing post along these line and cannot find any that address my need.

     

    I have a non-profit group that wants to upload water quality testing stats on a nightly basis to the web server database.

     

    Currently, the info is sampled by sensors in a pond, then transmitted to their local server (probably Windows type).

     

    They then want the info converted to MySql, then automatically get transported in the the web server database on a nightly basis.

     

    Now, all the up font stuff is no problem, but I have not gotten in to CRON jobs yet, and wonder if a php routine can be built that would upload the MySql table automatically every night.

     

    I have seen them for just the opposite (downloading table info), but not uploading.

     

    Can anyone help with direction on this?

     

    Would it be a fairly simple php routine?

     

    8)

  2. OK, thanks.

     

    Every thing is working, except the existing code does not have the registrants email coded in.  Right where I have the red comment, I need to put the variable "$email" so it appears in the email that is sent to the site administrator.

     

    This way, if the person registering is not a current site member, and is trying to gain access to the members only area, the site administrator can send them an email with an Adobe Acrobat application to join EGCA.

     

    So, if the registering person is an existing member, the adminitrator simply clicks on the validation link below, if not she sends the person an email.

     

    I hope that clears it up some.

  3. Hi all...

     

    I have a registration page for our members only area that works perfectly, except I want to add the registrants email in addition to existing info.

     

    What I have now is a validation setup.  When the registrant clicks send, it sends and email to the site administrator, with a link to automatically change the MySql validation field from 0 to 1.

     

    But, only current site members can gain access to the members only area.  So I need the registrants email in the validation email so our site administrator can send them an application to join the site prior to validating them for the members only area.  The email variable is $email

     

    Too much info?

     

    Anyway, here is the truncated coding - I can post the whole script if necessary:

    ==============================================================

    if (mail ("admin@egca.org", "Confirm EGCA Members Only Registration","Dear EGCA Administrator.\n\n

     

    If this is not a current EGCA Member, please send them an application package.  Email=<need to put their email right here )$email)>\n\n

     

    If this is a current EGCA member, click on the link below to activate their membership.\n\n

     

    If you are unable to click on the link, just paste the url given below in the address field of your browser and press enter to activate this account.\n\n

    $path/activate.php?email=$email&password=$password&key=$validkey","From: no-reply@egca.org"))

    ==============================================================

     

    Hope this is clear yet not too wordy.....

  4. Thanks jvrothjr, been away awhile, and didn't see your reply.  In the meantime I found a "canned" routine that works great.

     

    But, I will play with this one also just to gain more practical knowledge. 

     

    Thanks again!!

  5. I have an activation routine that sends me an email when someone signs up for our members only site.  All works great except I cannot seem to get a space between their first and last name.

     

    In the third line of the coding

    ($subject = $fname . $lname . " needs to be activated";)

    below, can you help me put a hard space between $fname and $lname?

     

    $email_admin = "admin@egca.org";

    $headers = 'From: Admin <admin@egca.org>';

    $subject = $fname . $lname . " needs to be activated";

    $msg .= "Of Company: $company \n";

    $msg .= "Please open the database EGCAORGA_USERS and table USERS then change the activation code from 0 to 1, for:\n";

    $msg .= "First Name - $fname, Last name - $lname\n";

    $msg .= "User Id - $userid, Password - $password\n";

    $msg .= "Email - $email\n";

    $msg .= "Company - $company";

     

  6. Hey all - want to dump a MySQL file to Excel.  Followed the tutorial "Exporting MySQL To Excel".

     

    I get an error on the actual dump.  It does dump the file, so I know I am connecting and downloading.  But, it puts all records in one line of text in the browser, and does not give me the prompt to download.

     

    Here is first, the error, then my code below (sans logon info).

    ========================================================

    Error Info:

     

    Warning: Cannot modify header information - headers already sent by (output started at /home/cleanair/public_html/excel.php:10) in /home/cleanair/public_html/excel.php on line 46

     

    Warning: Cannot modify header information - headers already sent by (output started at /home/cleanair/public_html/excel.php:10) in /home/cleanair/public_html/excel.php on line 47

     

    Warning: Cannot modify header information - headers already sent by (output started at /home/cleanair/public_html/excel.php:10) in /home/cleanair/public_html/excel.php on line 48

     

    Warning: Cannot modify header information - headers already sent by (output started at /home/cleanair/public_html/excel.php:10) in /home/cleanair/public_html/excel.php on line 49

    id Name Company Address City State Zip AreaCode Prefix Digits FaxArea FaxPrefix FaxDigits Email Copies "12" "Ronald Scott (Test #9)" "RsConcepts Consulting" "11470 Oak Creek drive " "Lakeside" "CA" "92040" "619" "312" "0799" "619" "312" "0802" "rscott7706@gmail.com" "2" "11" "Ronald Scott (Test #9)" "RsConcepts Consulting" "11470 Oak Creek drive " "Lakeside" "CA" "9204" "619" "312" "0799" "619" "312" "0802" "rscott7706@gmail.com" "2" "10" "Ronald Scott" "RsConcepts Consulting" "11470 Oak Creek drive " "Lakeside" "CA" "9204" "619" "312" "0799" "619" "312" "0802" "rscott7706@gmail.com" "2"

     

    =============================================================

     

     

    My Code:

     

    <?php

    define(db_host, "localhost");

    define(db_user, "");

    define(db_pass, "");

    define(db_link, mysql_connect(db_host,db_user,db_pass));

    define(db_name, "cleanair_dvd");

    mysql_select_db(db_name);

    ?>

     

    <?php

    $select = "SELECT * FROM requests";               

    $export = mysql_query($select);

    $fields = mysql_num_fields($export);

    ?>

     

    <?php

    for ($i = 0; $i < $fields; $i++) {

        $header .= mysql_field_name($export, $i) . "\t";

    }

    ?>

     

    <?php

    while($row = mysql_fetch_row($export)) {

        $line = '';

        foreach($row as $value) {                                           

            if ((!isset($value)) OR ($value == "")) {

                $value = "\t";

            } else {

                $value = str_replace('"', '""', $value);

                $value = '"' . $value . '"' . "\t";

            }

            $line .= $value;

        }

        $data .= trim($line)."\n";

    }

    $data = str_replace("\r","",$data);

    ?>

     

    <?php

    if ($data == "") {

        $data = "\n(0) Records Found!\n";                       

    }

    ?>

     

    <?php

    header("Content-type: application/x-msdownload");

    header("Content-Disposition: attachment; filename=extraction.xls");

    header("Pragma: no-cache");

    header("Expires: 0");

    print "$header\n$data";

    ?>

     

     

    Any ideas?  Thanks in advance!!

     

  7. Hi all, hope this is a simple one - I need to put the $msg items on separate lines.  All the info now appears as one long line.

    Can anyone help?

    $email_admin = "admin@xxx.org";
    $headers = 'From: Admin <admin@xxx.org>';
    $subject = $userid . "needs to be activated";
    $msg = $email . " needs to be activated.";
    $msg .= " Of $company . ";

    Thanks!!
  8. I don't like javascript's close a page

    <script language="JavaScript" type="text/javascript">
      window.close();
    </script>


    I don't know about anyone else, but I get complaints from users that it doesn't always work (and I have experienced it also).

    Is there a "PHP" close page code?
  9. I got it - sorry to jump for help too soon.  it is simple - here is the statement (gives you "Advertising"):

    $query = "SELECT * FROM members WHERE Directory_Catagory = 'Advertising' ORDER by Directory_Catagory";

    I am not sure the ORDER by stament is still necessary, but left it in.
  10. Hey all, hope all is well....

    I have a non-profit site that has business categories for their members (Accommodations, Advertising
    Agriculture & Livestock, Antiques, Crafts &Collectibles , etc.).


    I want to display records by category - but only that category.  For instance I want to display all records for Accommodations alone then after some html coding (links to the category and "top of page") start a new section that does the next category - Advertising.

    Here is my coding that groups by Directory_Catagory, but lists all the records.  Can we list only records by a certian category?

    $db = mysql_connect("localhost", "", "");
    mysql_select_db("lakeside_chamber");
    $query = "SELECT * FROM members GROUP by Directory_Catagory";

    $result = mysql_query($query) or die(mysql_error());
    echo "<font face=\"arial\">";
    while($row = mysql_fetch_array($result)){
        echo $row['Company_Name'];
        echo "<br />";
        echo $row['Directory_Catagory'];
        echo "<br />";
        echo $row['First_Name']. " " . $row['Last_Name'];
        echo "<br />";
        echo $row['Address']. " " . $row[''];
        echo $row['City']. ", " . $row['State']. " " . $row['Zip_Code'];
        echo "<br />";
        echo $row['Phone_Number'];
        echo "<br />";
        echo "<a href=mailto:'$row[Web_Email]'>".$row['Web_Email']."</a>";
        echo "<br />";
        echo "<a href='$row[Web_Site_Address]'>".$row[Web_Site_Address]."</a>";
        echo "<br />";
        echo "<br />";

    Thanks in advance!!

  11. I have a members only login script.  It verifies the users login name and password.

    I want it to verify the users login name, password and that the activted field is 1 (one) not 0 (zero).

    Being the good little newbie I am, I dilligently looked at the code and determined I would have to add code in connect.db:

    <?php

    define ('DB_USER', '');  // Database User Name
    define ('DB_PASSWORD', '');    // Database User Password
    define ('DB_HOST', 'localhost');  // Host Name (mostly localhost)
    $dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD);  // Establishes connection
    mysql_select_db('');    // database name to connect to

    define(TABLE_NAME,'users'); // Table Name
    define(USER_NAME,'userid'); // Username Field Name
    define(PASS_NAME,'password'); // Password Field Name
    define(ACTIVATED_NAME,'activated'); // Activated Field Name [color=red]<-----  added this code[/color]
    ?>

    Then change code in my login.php page:

    <?php
    session_start();

    //site_defines
    $SECURED_PAGE = 'http://www.egca.org/new_site/members-only/index.php';

    // If the form was submited check if the username and password match
    if($_POST['submitid'] == 1){
    //Call the database file
    require_once("connect.php");
    $userid = $_POST['userid'];
    $password = $_POST['password'];
    $activated = $_POST['activated'];  [color=red]<---- added this code[/color]
    $user_query = @mysql_query("SELECT * FROM " . TABLE_NAME . " WHERE `" . USER_NAME . "`='$userid' AND `" . PASS_NAME . "`='$password' [color=red]AND `" . ACTIVATED_NAME . "`='$ACTIVATED'.>0[/color]"); [color=red]<----- added code in red[/color]
    if(@mysql_num_rows($user_query) > 0){
    //Make sessions
    $_SESSION['isloged'] = 'yes';
    $_SESSION['userid'] = $_POST[userid];

    // Redirect to the page
    header("Location: $SECURED_PAGE");
    exit();
    } else {
    $message = 'Invalid username and/or password!';
    }

    It does not work, and I am hoping someone can lead me in the right direction.
  12. Right - gottcha...  And most of the routines I have looked at have that capability (the validation code) except they place the request in the admin panel.  I would like the activation code to be sent to an email address.  There is where my lack of programming limits me.

    :)
  13. I had a simple but unique, open source, user authentication program some time back, but can't find it now.

    It basically would provide a registration page, that allowed the web visitor to register by entering (may have had other fields, but these are what I need):
    first name
    last name
    company
    desired username
    desired password

    The script then posted to a database that contained a 'validate" field.  This field remained (0, 1, or just null - can't remember now).

    Now here is the trick, when they submitted the form, it sent an email with a link to the "administrator"  and all the adminsitrator had to do was click on this link within the email and it would change the "validate" field from the one selection (not validated) to another (validated).

    The reason I need it this way is the "admin" is an administrative assistant for a non-profit company I am helping.  She is not computer savy to this extent so the email verification is just the 'cats pajamas"...

    Most validation programs either approve the user right away, or require the admin logs on to an admin panel to approve the person registering.

    Does this strike a cord in anyone?
×
×
  • 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.