Jimmy
Jimmy

Reputation: 12497

Static site post form to different domain

I am wondering if this is a programmatically possible. I want to have a static site which can also be used to add items on a database existing on a different server and domain.

The flow for posting items is as follows:

Post Item Details -> Pay -> Confirmation Page

From what I can see, it is possible to post to a different domain (dynamic) like this without needing javascript:

<form action="http://post.test.com" id="form" method="post" name="contact-form">

My questions about this method are:

  1. Can transfer them to the payment page after they have posted the item detail form?
  2. What happens if they don't fill out the form correctly, can I send them back to the form if they used invalid values?
  3. Is this a good approach to this problem?

Upvotes: 0

Views: 94

Answers (1)

Ana Claudia
Ana Claudia

Reputation: 507

  1. Try using header('Location: http://www.example.com/'); to transfer them to the payment page.

  2. Try using form validation to check if they have filled the form correctly before sending it.

Upvotes: 2

Related Questions