0

I am Designing and developing Bus reservation portal in VUEJS, when I click on (search buses) button. I want to call external PHP page, where it will show the search result.

I have hosted reference link here http://d1brg6zcfjtxzw.cloudfront.net/#/bus

Please help!

Balram Sharma
  • 119
  • 1
  • 3
  • 15
  • You need to clarify what "call external page" means. Is there a REST API hosted at this other page? Do you want to do an HTTP POST? An HTTP GET? Are you sending data to that page? – PatrickSteele Jan 16 '18 at 13:44

2 Answers2

0

If you need call domain other than yours, you need to enable your CORS options in your PHP code.

https://enable-cors.org/server_php.html

Fyi, instead of * value in example, you should set your own domain(s). But in testing stage, you can use as *

Onur Özkan
  • 918
  • 1
  • 10
  • 20
  • its in same domain, its just that instead of **search.vue** I want to make **search.php** but how to call this page on form submit. For example, the page will be something like www.xys.com/search.php – Balram Sharma Jan 16 '18 at 13:25
0

You need learn about REST. You can send GET/POST request with Vue Resource library on changing input or clicking on button, and parse response from server. Response from server can contain JSON and you can JSON.parse() them, and place in your data() or in the store.