We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Ajax request brings me back to index page when I "GET" a url from the server

How Do I?

GlobalNewsAlliance's avatar
GlobalNewsAlliance
5 posts
8 years ago
GlobalNewsAlliance's avatar GlobalNewsAlliance

So I am trying to make my template communicate with a php file on my server which, in turn communicates with twilio in order to create a text message triggered by the template. The php file is on my server. The template has an AJAX GET and SEND function to the url of the php file on my server. I tested it on my server it works perfectly. I put the same code in my template and I am (?) surprisingly receiving my index page in return. I suspect that it is some kind of EE prevention against injection attacks but have no idea how to solve this dilemma for myself.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
8 years ago
John Henry Donovan's avatar John Henry Donovan

The php file and whatever you have it may be better off being turned into a quick plugin?

What version of EE are you using?

If that’s not your thing then I would check the PHP prefs for the template itself and see it it is set to Output or Input

Can you share any of what you are doing?

       
GlobalNewsAlliance's avatar
GlobalNewsAlliance
5 posts
8 years ago
GlobalNewsAlliance's avatar GlobalNewsAlliance

Hey Donovan thank you for replying, actually I have just solved my dilemma with a simple solution. The url link I had for my php form in the server was missing the “http://”, for some reason this caused it to load my index page every single time. Now it works! Thank you for your help anyway

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
8 years ago
John Henry Donovan's avatar John Henry Donovan

No problems. Glad you found a solution.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.