SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cookies, form and MySQL Database

    Hi,

    Asked this before but perhaps I was not clear enough.

    I have a form whereby the data needs to be input into a MySQL database in the row in the table where the previously stored cookie id in the MySQL table matches that on the users computer.

    I know how to write a form. How do I post it to a MySQL database and have the data entered in the correct row (by checking the cookie id matches)?

    Matt.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,401
    Mentioned
    147 Post(s)
    Tagged
    4 Thread(s)
    php mysql form tutorial - Google Search

    This should give you some good examples of how to handle form data in PHP and save it in your database table.
    Please don't hesitate to ask about any specific problems you encounter.

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers - thanks.

    I found a tutorial and I have a question. When a customer has entered their name, telephone number, delivery address, etc. they click 'continue' and they then go through to the Card Processing company (SagePay, WorldPay etc.).

    As you probably know when submitting a form using post you use the code:

    PHP Code:
    <form action="insert.php" method="post"
    within the insert.php coding I would use a function (the function might be coded on a separate php page) that enters the data into the database .

    If I send customers to the Customer Processing page the code would have to be:

    PHP Code:
    <form action="worldpay-payment-page.php" method="post"
    And I would not be able to edit their web page. Is there a way to post to one page and have the customer be redirected to another.

    The only way I see it could be done is with a auto-redirect so that they go to insert.php and then they automatically get redirected to the Payment Processing company web page. But in my experience I have never bought something online and been automatically redirected...it just goes straight to the payment screen at the Processing Company.

    I hope you know a better way to get around this issue.

    Matt.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •