Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by phppup

  1. I know that I can fairly easily pull my data from the database and view it in a browser.

    I can also 'polish' it with some HTML or put it into a table.

    Can I get an item from a given VARIABLE to appear inside of an INPUT box, so that it looks the same as when it was initially submitted?

    Can it be done with a multiple choice SELECT dropdown, so that the item chosen is viewable again?

  2. TWO questions:


    I haven't actually CONNECTED and POSTED.  My form has two input fields that combine in a TOTAL field. I notice that the address bar is carrying TOTAL=input1+input2 when it TRIES to connect.  Do I need to include

    the TOTAL field in the database if the info is NOT relavant data? the strg and chick TOTALS? 


    Will the database accept PARTIAL data from a form that has 25 field with only 6 being populated for testing?


  3. My form begins with:

    <form name="orderpage" action="passpost.php" method="post">



    OOPS!!! never mind.  Now I feel stupid.  Been staring at this for 6 hours, and when I cut and pasted the code I noticed I had 2 form tags, so the submit was actually outside the process.  Now I'm fine.


    This is why I'm just a PUP (or PUPIL) at this point.  Sometimes you just need a second set of eyes to see it!


    Thanks for the assist.


  4. The HTML looks something like this all the way throuogh:


          <select name="brisket">

            <option value="0.00" selected>  --- </option>

            <option value="1.00">  1  </option>

            <option value="2.00">  2  </option>

            <option value="3.00">  3  </option>

            <option value="4.00">  4  </option>

            <option value="5.00">  5  </option>

            <option value="6.00">  6  </option>

            <option value="7.00">  7  </option>

            <option value="8.00">  8  </option>

            <option value="9.00">  9  </option>

            <option value="10.00">10  </option>

          </select></td><td>BRISKET OF BEEF</td><td>32.00 LB</td><td>ujiujjpooj</td><td> <!-- FILLER --> </td>


          <select name="carrots">

            <option value="0.00" selected>  --- </option>

            <option value="1.00">  1  </option>

            <option value="2.00">  2  </option>

            <option value="3.00">  3  </option>

            <option value="4.00">  4  </option>

            <option value="5.00">  5  </option>

            <option value="6.00">  6  </option>

            <option value="7.00">  7  </option>

            <option value="8.00">  8  </option>

            <option value="9.00">  9  </option>

            <option value="10.00">10  </option>



    and my PHP is here:





    mysql_connect("$hostname", "$username", "$password") or die ('Unable to connect to database!);

    mysql_select_db("$database") or die('Could not connect to db: ' . mysql_error());


    if(isset($_POST['action']) && $_POST['action'] == 'submitform')


    $roastturkey = $_POST['roastturkey'];

    $broccoli = $_POST['broccoli'];

    $brisket = $_POST['brisket'];

    $carrots = $_POST['carrots'];

    $EZchix_sum= $_POST['EZchix_sum'];

    $chixcutlet = $_POST['chixcutlet'];

    $chixfingers = $_POST['chixfingers'];


    $strgbalmond1 = $_POST['strgbalmond1'];

    $strgbalmond2 = $_POST['strgbalmond2'];

    $strgbalmond3 = $_POST['strgbalmond3'];



    $sql = "INSERT INTO dinnertable (roastturkey,broccoli,brisket,carrots,chixcutlet,chixfingers,strgbalmond1,strgbalmond2,strgbalmond3) VALUES




    // if successfully insert data into database, displays message "Successful".


    echo "Successful";

    else {

    echo "ERROR";




    I just noticed that the feature for the TOTAL chicken and strgbalmond were being carried in the address bar.  They are not important for my database, but maybe i needfields for them anyway????


    Anditionally, I created a simple form with one field and a submit and ran it through my insert script and I got a successful connection and error message.  Then I re-wrote my button on this form, and still no connection.


    Is the something about HTML 'selects' that I'm missing?  Or a PHP comma or quote??


  5. I have a form with a table that contains ONLY dropdown menus for users to select quantities from 25 dinner items.  It contains some Javascript, but nothing fancy.  In an effort to establish my database and TEST to see how some PHP functions might respond so I could improve my form, I created a mini version of the db in MySQL.


    But when I click the submit button, the page blinks, the address bar fills with field names, but there is no connect.  No error messages.  No data transfer.  NO NOTHING!


    I searched the web and copied a form and plugged it in (an html form, a php insert file, and a MySQL database) and it worked fine.  I peared down my page to mirror it, and still, no success.


    What little detail am I missing??  If I have 25 fields but create a db for the first 6, should it function?

    If I reduce it and try to re-use the same db, am I persuing a problem?

    I've tried error trapping and changing the form inputs, but it just still doesn't connect.


    Please help!

  6. As long as I'm logged in (although this may be more to the topic of 'table structure'), my table has fields for small, medium, and large blue candles and small, medium, and large pink candles.

    When an order is placed, the quantity requested is INSERTED into the correct field.


    Am I creating unnecessary overhead?


    Is there a way to have just one field for blue candles and one for pink, whereby the INSERT will record a customer request for 4 candles that are the small size?  And how would I retrieve the data when I want to know both the total number of candles and their sizes.


    Note: the order form has radio buttons for the sizes, so a single order can only accept a single size per submission.  Not sure if there's a simple way around that, but I'm learning more each day.


    Thanks in advance.

  7. Details:  Working for a company that sells candles in packages of 1,2,3,4,5 and 6. 

    Their website is set, and their database is adequate.


    Situation: I need to be able to breakdown large orders for efficient packaging.  So, if a customer orders twelve candles, I could transpose the order into 2 six-packs.  If the order were for sixteen candles, the order would transpose to 2 six-packs and 1 four-pack.  Always using the largest sized sets possible.

    Do NOT want an order for 12 being assembled as 3 fours or 4 threes, as it is inefficient.


    Can the quantity be INSERTED into the table accordingly, or does it need to be inserted as 16 (for example) and then broken down afterward??


    I am not sure whether I can do this in PHP or if a JavaScript is better.


    Obviously, i need to divide the largest orders by six, but not sure how to get that number, and how to incorporate the remainder.


    Please help.


    i used to have a stress ball.... ya know, those rubbery things for you to squeeze and throw to AVOID real damage, but I broke it! 




  8. Some attendees submitted duplicate (but identical) information into the form in order to obtain more than one ticket, so they occuppy several record lines.  However, I only need to send ONE email to that person.  How can I filter through the records to make sure that only one email is sent even though the same email address may have been entered several times, so that I eliminate duplication?


    In other words, to send ONE email to each UNIQUE address.

  9. Yes, very generic and I apologize.  It's probably due to my novice status.  I've searched websites and bookstores and it seems that authors write volumes on the cars performance ability, but never show you where to put the key or which way to start the ignition.


    I don't have a preference as to where I run the script (probably because I haven't had the initial experience foro comparison yet).


    I know that I'm not trying anything too complicated.  The alternative I considered was to create an HTML form (in a hidden file).  This would give me a SUBMIT button to act as my "on switch" to get the ball rolling.  Is this my simplest solution? 


    Can I place the file in my FTP with the website, use a particular extension, double click, and have my operation underway?


    Many thanks for your help.

  10. I have a database with three fields: name, email, and event.  People signed on through a form and provided this information each time they wanted a ticket to attend Thanksgiving, Christmas, and New Years parties.


    Now I want to contact them by email WITHOUT using a CC or BCC function because I do NOT want my messages filtered as spam.


    How can I send each person a single email?

  11. I've been using a PHP form to post to MySQL. Now that I've begun to build a database, I'm ready to sort some data. I've seen references to building scripts and then running them. But EXACTLY how do i RUN the script to get results. Do I create an icon in my ftp files and double click it? Do I need to create a form and hit the submit button??

    I'm sure there's a simple answer, but I don't know it.

    Please teach me.



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