Jump to content

artweb

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Posts posted by artweb

  1. There my php code now.

    <?php

     

    $subject ="order form";

     

    $message="

    if ($companyname) $message = $message . 'Company Name:' . $companyname . '<br>';

    if ($address) $message = $message . 'Address:' . $address . '<br>';

    if ($city) $message = $message . 'City:' . $city . '<br>';

    if ($state) $message = $message . 'State:' . $state . '<br>';

    if ($zip) $message = $message . 'Zip:' . $zip . '<br>';

    if ($contact_person) $message = $message . 'Contact Person:' . $contact_person . '<br>';

    if ($phone) $message = $message . 'Phone:' . $phone . '<br>';

    if ($fax) $message = $message . 'Fax:' . $fax . '<br>';

    if ($email) $message = $message . 'Email:' . $email . '<br>';

    if ($question) $message = $message . 'Question:' . $question . '<br>';

    ";

     

     

     

     

     

    $mail_from="$email";

    $header="from: $companyname <$email>";

    $to ='';

    $done=mail($to,$subject,$message,$header);

     

    ?>

     

     

     

    This is what the email looks like. You can see that the Zip and The Email have been left blank but they still show in the email. I want them to be left out of the email when they have not been filled in.

     

    if (new)  =  . 'Company Name:' . new . '<br>';

    if (dsf)  =  . 'Address:' . dsf . '<br>';

    if (adsf)  =  . 'City:' . adsf . '<br>';

    if (adsf)  =  . 'State:' . adsf . '<br>';

    if ()  =  . 'Zip:' .  . '<br>';

    if (fds)  =  . 'Contact Person:' . fds . '<br>';

    if (sdfa)  =  . 'Phone:' . sdfa . '<br>';

    if (sdf)  =  . 'Fax:' . sdf . '<br>';

    if ()  =  . 'Email:' .  . '<br>';

    if (asdf)  =  . 'Question:' . asdf . '<br>';

     

  2. The customer come to my form, and lets say they only fill out the city and state. Then when I get the email it says the following:

     

    Company Name:

    Address:

    City:somewhere

    State:nowhere

    Zip:

    Contact Person:

    Phone:

    Fax:

    Email:

    Question:

     

    I want the email to only have this: Not all the other category that they left blank.

     

    City:somewhere

    State:nowhere

     

     

    This is what my code looks like.

     

    <?php

     

    $subject ="order form";

    }

    $message="

    Company Name: $companyname,

                   

    Address: $address,

    City: $city,

    State: $state,

    Zip: $zip,

    Contact Person: $contact_person,

    Phone: $phone,

    Fax: $fax,

    Email: $email,

    Question: $question,;

     

    $mail_from="$email";

    $header="from: $companyname <$email>";

    $to ='';

    $done=mail($to,$subject,$message,$header);

    ?>

  3. I have a email form that lets people order products from a company.

    When the email come in it has every product that's on the form in the email. I want to have just the product the customer orders show in the email. How do I control this with the $subject. I hope this make sense.

  4. I have alot of html forms that use php to email the form. It has worked just fine until today and now it stop working on all my forms.

    It says The info has been sent to email but when I check there no email in my box. Heres my code.

     

    The html form---<form method="post" action="piperfq.php">

     

     

    <?php
    // Contact subject
    $subject ="Pipe rfq Form";
    // Details
    $message="
    Company Name: $companyname,
    Address: $address,
    City: $city,
    State: $state,
    Zip: $zip,
    Tel: $tel,
    Cell: $cell,
    Fax: $Fax,
    Requested by: $requested,
    First Name: $frist_name,
    Last Name: $last_name,
    Email: $email,
    
    
    
    
    PART DESCRIPTION
    
    
    Blasting: $blasting,
    
    Largest Pipe Diameter: $largest_pipe_diameter,
    
    Smallest Pipe Diameter: $smallest_pipe_diameter,
    
    Longest Pipe: $longest_pipe,
    
    Shortest Pipe: $shortest_pipe,
    
    Pipe Material ASTM grade: $grade,
    
    Pipe Material: $pipe_material,
    
    Other Pipe Material: $other_pipe_material,
    
    Maximum Weight: $maximum_weight,
    
    lbs per: $lbs_per,
    
    Part Pre Blast Condition: $pre_blasting,
    
    Paint & Type: $paint_type,
    
    Other Part Pre Blast Condition: $other_pre,
    
    Finish Needed: $finish_needed,
    
    Describe any profile needed or other finish spec's: $other_finish,
    
    Production Rate needed: $pro_rate,
    
    FPM on: $fpm,
    
    dia.: $dia,
    
    Machine Operating Hours: $day,
    
    day: $week,
    
    Are Pipes Sizes Ran In Batches or Random?: $batch_random,
    
    Most Common Sizes Processed: $common_sizes,
    
    Most Common Pre Condition Processed: $common_pre,
    
    Are Sample Parts Available?: $sample_parts,
    
    
    
    
    
    MATERIAL HANDLING
    
    
    How Will Pipes Be Loaded?: $loaded_pipe,
    
    How Will Pipes Be Unloaded?: $unloaded_pipe,
    
    Feet Of Load & Unload Conveyor Needed With The Blaster?: $feet_load,
    
    Will The Blaster Be Placed In Line With Other Equipment?: $line_equipment,
    
    How Are The Items Presently Cleaned?: $items_cleaned,
    
    
    
    
    
    BUILDING AND WORK AREA LIMITATIONS
    
    
    Ceiling Height Limitation: $ceiling,
    
    Door Opening: $door,
    
    
    
    
    
    SERVICE AVAILABLE
    
    
    Voltage: $voltage,
    
    Phase: $phase,
    
    Amps: $amps,
    
    Air: $air,
    
    Exhaust Vent: $exhaust_vent,
    
    
    
    
    
    
    DUST COLLECTOR
    
    
    Include In Base Price?: $base_price,
    
    Quote As Option?: $quote_as_option,
    
    Located?: $located,
    
    HEPA Filter on Dust Collector?: $filter_collector,
    
    Other Information or Notes: $other,
    
    Known Competition: $known_competition,
    
    Details of Machines Quoted: $machines_quoted";
    
    // Mail of sender
    $done=mail($to,$subject,$message,$header);
    
    // From
    
    
    // Enter your email address
    $mail_from="$email";
    $header="from: $customer_name <$email>";
    $to ='web@lsindustries.com';
    $done=mail($to,$subject,$message,$header);
    
    
    
    
    // Check, if message sent to your email
    // display message "We've received your information"
    if($done){
    echo "We've received your contact information";
    }
    ?>

  5. If I don't connect to the second table how will I be able to insert into.

     

    The first table is for storing username and passwords so when user fills out the form to login, it checks the database for that username and password if it finds it. It will let them in to the protected part. If not  it makes them try again.

     

    The second is for recording when the user logs in. It records even if the user has to try again.

  6. Thanks for your help :)

    Ok, I changed it like this, code below, and now nothing get recorded into my second table. I still don't know what I'm doing. Please help more.

     

    <?php

     

     

    $tbl_name="members"; // Table name

     

     

    // Connect to server and select databse.

    mysql_connect("$host", "$username", "$password")or die("cannot connect");

    mysql_select_db("$db_name")or die("cannot select DB");

     

    // Define $myusername and $mypassword

    $myusername=$_POST['myusername'];

    $mypassword=$_POST['mypassword'];

     

    $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";

    $result=mysql_query($sql);

     

     

    //mysql_num_row is counting table row

    $count=mysql_num_rows($result);

    //if result match  $myusername  and mypassword  table row must be 1 row

     

    if($count==1){

    session_register("myusername");

    header("location:happy.php");

    mysql_connect("$host", "$username", "$password")or die("cannot connect");

    mysql_select_db("test_mysql")or die("cannot select DB");

     

    $sql="INSERT INTO test_mysql(companyname, myusername, mypassword)VALUES('$companyname', '$myusername', '$mypassword')";

    $result=mysql_query($sql);

    }

    else {

    echo "Wrong Username or Password";

    }

     

    ob_end_flush();

    ?>

     

  7. I have a mysql database set up. where I manual go in and put the usernames and Passwords of customer that register with me though my email. Then when they receive and email from me telling then they can login. I also have another table set up to record their login info, company name and usernmane and password. The problem is I want this to only work if the user is in the first table. But  even if the user doesn't exist in my first table it records everything in my second table. So I need something like if login successful insert into second table. But only if successful. Please help ???

     

    code bellow:

     

     

     

    <?php

    ob_start();

    $host=""; // Host name

    $username=""; // Mysql username

    $password=""; // Mysql password

    $db_name=""; // Database name

    $tbl_name="members"; // Table name

     

     

    // Connect to server and select databse.

    mysql_connect("$host", "$username", "$password")or die("cannot connect");

    mysql_select_db("$db_name")or die("cannot select DB");

     

    // Define $myusername and $mypassword

    $myusername=$_POST['myusername'];

    $mypassword=$_POST['mypassword'];

     

    $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";

    $result=mysql_query($sql);

     

     

    //mysql_num_row is counting table row

    $count=mysql_num_rows($result);

    //if result match  $myusername  and mypassword  table row must be 1 row

     

    if($count==1){

    session_register("myusername");

    header("location:happy.php");

    }

    else {

    echo "Wrong Username or Password";

    }

    if($count==1){

    mysql_connect("$host", "$username", "$password")or die("cannot connect");

    mysql_select_db("test_mysql")or die("cannot select DB");

    }

    $sql="INSERT INTO test_mysql(companyname, myusername, mypassword)VALUES('$companyname', '$myusername', '$mypassword')";

    $result=mysql_query($sql);

    ob_end_flush();

    ?>

     

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