Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Joel Muro
Joel Muro
2,884 Points

Writing a php script that edits a field on another webpage

I'm learning about php but how do you write commands to edit fields on a different website ?

3 Answers

Codin - Codesmite
Codin - Codesmite
8,600 Points

You would need to use Insightly's developer API (application program interface) to peform these actions.

https://api.insight.ly/v2.1/Help

For obvious security reasons Insightly are not going to allow another website to directrly inject PHP code into their own website.

BUT they provide an API to allow you to call certain pre-defined functions from their website to your own. In the same way that for example you would have a share button for Facebook or embedding a twitter stream into your website.

Refer to the API documentation above for explination of how it works.

Their support email is support@insight.ly if you have any further queries that the API does not solve.

Joel Muro
Joel Muro
2,884 Points

Im trying to write a php script to to change the field of another website called insightly . Insightly is a crm and on each specific page for an order you can change the status of an order from received to shipped . How do I write a php script to change the status from received to shipped from a different webpage . Does that help?

Casey Ydenberg
Casey Ydenberg
15,622 Points

A bit.

PHP is a backend programming language that you can use to create your own websites. It doesn't really interact (directly) with browsers, which is where fields live. If you want a little script that can modify form fields as you fill them out in a browser, check out JavaScript.

If on the other hand you want a programmatic way to update your information in an online database (that usually powers a website but might not), this is typically done through a web API (application programming interface). Exactly how the API works - if it exists at all - depends on the owner of the database, in this case Insightly. You'll probably need to get pretty far along with your PHP first, then check out Insighly's documentaion and see what you need to do.

Joel Muro
Joel Muro
2,884 Points

So insightly is an online crm . So php would not work ? When you say documentation u mean going to insightly and looking at there source code through a web browser ? So it would take pretty advanced php coding to be able to have code that would go to a website and change a field .