1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php mysql flat file operations

Discussion in 'PHP' started by phpwreker, Nov 4, 2012.

  1. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #21
    [​IMG]


    i was wondering if i could do a process order of a customer ...

    i have very little idea on what are all the things involved in this side .. of the customer order page
     
    Last edited: Dec 6, 2012
    phpwreker, Dec 6, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #22
    And you have to learn them before you'll be able to do them.

    You seem to think that all it takes to develop a site is for someone to give you a few instructions, and you can do the rest. It's not. You can't write code until you learn to write code, and if you're really good that can take 6 months or more. (A CS degree, which is 'how to write code' takes 4 years, and that's the basics.)
     
    Rukbat, Dec 7, 2012 IP
  3. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #23
    i wish i could take the order of one customer and send his icecream home
     
    phpwreker, Dec 7, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #24
    You design the hardware that can do it, and I'll develop the website that they can use to order and pay for it.
     
    Rukbat, Dec 7, 2012 IP
  5. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #25
    lol

    i just figured out something a bit more simpler

    [​IMG]

    i need a connection betweem order icecream page and fill in shipping address link
     
    phpwreker, Dec 7, 2012 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #26
    You need a connection between "I don't know anything about programming" and "I want to write code". It's called "studying".
     
    Rukbat, Dec 7, 2012 IP
  7. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #27
    yea.. buidling up a frame work .. so that i can work my arse on it someday

    [​IMG]
     
    phpwreker, Dec 7, 2012 IP
  8. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #28
    this is a second version of the same concept ...

    [​IMG]

    the script sends an email .. to the administrator ...

    but .. donno who is it from ? how can i make it look like its from a particular user ?



    As a website becomes more sophisticated, so must the code that backs it. When you get to a stage where your website need to pass along user data from one page to another, it might be time to start thinking about using PHP sessions.

    A normal HTML website will not pass data from one page to another. In other words, all information is forgotten when a new page is loaded. This makes it quite a problem for tasks like a shopping cart, which requires data(the user's selected product) to be remembered from one page to the next.
     
    Last edited: Dec 8, 2012
    phpwreker, Dec 8, 2012 IP
  9. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #29
    Bty learning programming and the SMTP protocol.

    Unless you have the experience to write the "more sophisticated" code right from the start.

    Or you start the site using PHP, so that when you need it you just add some code instead of having to rewrite the entire site.

    A shopping cart also needs a database and the ability to query a credit card provider, which means server-side code right from the beginning.

    But copying and pasting something you don't understand from a site somewhere isn't going to teach you wnat you need to create your own site. Only studying will.

    (You have 1 mouth, 2 eyes and 2 ears. That seems to be a hint to listen and look twice as much as you speak.)
     
    Rukbat, Dec 8, 2012 IP
  10. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #30
    i was wondering how to send the user details to the rest of the page and email too

    [​IMG]
     
    Last edited: Dec 9, 2012
    phpwreker, Dec 9, 2012 IP
  11. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #31
    <form action="" name="priceCalc" method="POST"> I Am Paying For : <select name="item" onchange="price();"> <option value="15">item 1 - $15.00</option> <option value="35">item 2 - $35.00</option> <option value="35">item 3 - $35.00</option> <option value="29.90">item 4 - $29.90</option> <option value="29.90">item 5 - $29.90</option> <option value="26.90">item 6 - $26.90</option> <option value="32.90">item 7 - $32.90</option> <option value="59.90">item 8 - $59.90</option> <option value="59.90">item 9 - $59.90</option> </select> <br /> <br /> Quantity : <select name="quantity" onchange="price();"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <br /> <br /> Please deposit the freight free full total of <br /> <span style="color:red; font-size:18px;" id="prices">$</span> into our account : <br /> <input type="submit" name="submit" value="BUY NOW!" /> </form>​ /* JavaScript */ function price() { var qty = document.priceCalc.quantity; var itm = document.priceCalc.product; var price = parseInt(qty.value) * parseInt(itm.value); document.getElementById("prices").innerHTML = '$' + price; }​




    <?php $item = $_POST["item"]; $quantity = $_POST["quantity"]; $subject = "Website Sale!"; $emailto = "myemail@test.com"; // prepare email body text $body .= ""; $body .= "To Sales Team"; $body .= "\n"; $body .= "\n"; $body .= "I have purchased "; $body .= $quantity; $body .= "x "; $body .= $item; $body .= "\n"; $body .= "\n"; $body .= "Please look out for my payment in the account over the next few days."; // send email $success = mail($emailto, $subject, $body"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../order_sent.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=../index.php\">"; } ?>​
     
    phpwreker, Dec 9, 2012 IP
  12. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #32
    the page is really like .. the user logins ...

    gets to the order product page ..

    its a session protected page .. where only a login user can see the page ...

    after a login user sees the page .. he gets a form to order the product



    [​IMG]

    <?php
    session_start();
    $_SESSION['username'];
    ?>



    form
    $item
    $quantity

    script
    $item = $_POST { "item " ];
    $quantity = $_post { "quantity" ] ;


    how do i include a $session variable too in the form ...?

    so which one is the session variable name .. which one is the variable ..

    how do i take that variable and email it through that form ?

    input name , input .................... ?
     
    Last edited: Dec 9, 2012
    phpwreker, Dec 9, 2012 IP
  13. phpwreker

    phpwreker Greenhorn

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #33
    i looked at the form again ...


    <?php
    $quantity = $_GET["quantity"];
    $item = $_GET["item"];
    $subject = "Website Sale!";
    $emailto = "myemail@test.com";

    i was wondering if i could add this too

    $session = $_GET["session"];
     
    phpwreker, Dec 9, 2012 IP
  14. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #34
    <form action="the name of the file you're sending the data to" ...

    All the data in named elements gets sent to that file.
     
    Rukbat, Dec 9, 2012 IP