PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/demo-linkedin/jobsPosting.php

https://bitbucket.org/insigngmbh/socialapi
PHP | 579 lines | 369 code | 69 blank | 141 comment | 65 complexity | 520949831114f5a0746722448bf78fea MD5 | raw file
  1. <?php
  2. /**
  3. * This file is used in conjunction with the 'LinkedIn' class, demonstrating
  4. * the basic functionality and usage of the library.
  5. *
  6. * COPYRIGHT:
  7. *
  8. * Copyright (C) 2011, fiftyMission Inc.
  9. *
  10. * Permission is hereby granted, free of charge, to any person obtaining a
  11. * copy of this software and associated documentation files (the "Software"),
  12. * to deal in the Software without restriction, including without limitation
  13. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  14. * and/or sell copies of the Software, and to permit persons to whom the
  15. * Software is furnished to do so, subject to the following conditions:
  16. *
  17. * The above copyright notice and this permission notice shall be included in
  18. * all copies or substantial portions of the Software.
  19. *
  20. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  24. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  25. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  26. * IN THE SOFTWARE.
  27. *
  28. * SOURCE CODE LOCATION:
  29. *
  30. * http://code.google.com/p/simple-linkedinphp/
  31. *
  32. * REQUIREMENTS:
  33. *
  34. * 1. You must have cURL installed on the server and available to PHP.
  35. * 2. You must be running PHP 5+.
  36. *
  37. * QUICK START:
  38. *
  39. * There are two files needed to enable LinkedIn API functionality from PHP; the
  40. * stand-alone OAuth library, and the Simple-LinkedIn library. The latest
  41. * version of the stand-alone OAuth library can be found on Google Code:
  42. *
  43. * http://code.google.com/p/oauth/
  44. *
  45. * The latest versions of the Simple-LinkedIn library and this demonstation
  46. * script can be found here:
  47. *
  48. * http://code.google.com/p/simple-linkedinphp/
  49. *
  50. * Install these two files on your server in a location that is accessible to
  51. * this demo script. Make sure to change the file permissions such that your
  52. * web server can read the files.
  53. *
  54. * Next, make sure the path to the LinkedIn class below is correct.
  55. *
  56. * Finally, read and follow the 'Quick Start' guidelines located in the comments
  57. * of the Simple-LinkedIn library file.
  58. *
  59. * @version 3.2.0 - November 8, 2011
  60. * @author Paul Mennega <paul@fiftymission.net>
  61. * @copyright Copyright 2011, fiftyMission Inc.
  62. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  63. */
  64. /**
  65. * Session existance check.
  66. *
  67. * Helper function that checks to see that we have a 'set' $_SESSION that we can
  68. * use for the demo.
  69. */
  70. function oauth_session_exists() {
  71. if((is_array($_SESSION)) && (array_key_exists('oauth', $_SESSION))) {
  72. return TRUE;
  73. } else {
  74. return FALSE;
  75. }
  76. }
  77. $job_post_template = <<<TEMPLATE
  78. <?xml version="1.0" encoding="UTF-8" ?>
  79. <job>
  80. <partner-job-id>XXXX</partner-job-id>
  81. <contract-id>XXXX</contract-id>
  82. <customer-job-code>XXXX</customer-job-code>
  83. <company>
  84. <id>XXXX</id>
  85. <name>Test Company ABC</name>
  86. <description>A great company</description>
  87. </company>
  88. <position>
  89. <title>Test Chief Architect</title>
  90. <description>This is a great job.</description>
  91. <skills-and-experience>Programming, financial analysis, and thought leadership.</skills-and-experience>
  92. <location>
  93. <country>
  94. <code>us</code>
  95. </country>
  96. <postal-code>10012</postal-code>
  97. <name>Midtown Manhattan</name>
  98. </location>
  99. <job-functions>
  100. <job-function>
  101. <code>acct</code>
  102. </job-function>
  103. <job-function>
  104. <code>dsgn</code>
  105. </job-function>
  106. </job-functions>
  107. <industries>
  108. <industry>
  109. <code>38</code>
  110. </industry>
  111. <industry>
  112. <code>44</code>
  113. </industry>
  114. </industries>
  115. <job-type>
  116. <code>C</code>
  117. </job-type>
  118. <experience-level>
  119. <code>4</code>
  120. </experience-level>
  121. </position>
  122. <salary>\$100,000-120,000 per year</salary>
  123. <referral-bonus>\$5,000 for employees</referral-bonus>
  124. <poster>
  125. <display>true</display>
  126. <role>
  127. <code>R</code>
  128. </role>
  129. <email-address>user@example.com</email-address>
  130. </poster>
  131. <how-to-apply>
  132. <application-url>http://www.domain.com</application-url>
  133. </how-to-apply>
  134. <tracking-pixel-url>http://www.domain.com/track.gif</tracking-pixel-url>
  135. </job>
  136. TEMPLATE;
  137. $job_edit_template = <<<TEMPLATE
  138. <?xml version="1.0" encoding="UTF-8" ?>
  139. <job>
  140. <position>
  141. <title>Test Chief Architect</title>
  142. <description>This is a great job.</description>
  143. <skills-and-experience>Programming, financial analysis, and thought leadership.</skills-and-experience>
  144. </position>
  145. <salary>\$100,000-120,000 per year</salary>
  146. <referral-bonus>\$5,000 for employees</referral-bonus>
  147. </job>
  148. TEMPLATE;
  149. try {
  150. // include the LinkedIn class
  151. require_once('../linkedin_3.2.0.class.php');
  152. // start the session
  153. if(!session_start()) {
  154. throw new LinkedInException('This script requires session support, which appears to be disabled according to session_start().');
  155. }
  156. // display constants
  157. $API_CONFIG = array(
  158. 'appKey' => '<your application key here>',
  159. 'appSecret' => '<your application secret here>',
  160. 'callbackUrl' => NULL
  161. );
  162. define('CONNECTION_COUNT', 20);
  163. define('PORT_HTTP', '80');
  164. define('PORT_HTTP_SSL', '443');
  165. define('UPDATE_COUNT', 10);
  166. // set index
  167. $_REQUEST[LINKEDIN::_GET_TYPE] = (isset($_REQUEST[LINKEDIN::_GET_TYPE])) ? $_REQUEST[LINKEDIN::_GET_TYPE] : '';
  168. switch($_REQUEST[LINKEDIN::_GET_TYPE]) {
  169. case 'close_job':
  170. /**
  171. * Handle job closing requests.
  172. */
  173. // check the session
  174. if(!oauth_session_exists()) {
  175. throw new LinkedInException('This script requires session support, which doesn\'t appear to be working correctly.');
  176. }
  177. // set the object
  178. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  179. $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
  180. // proceed flag
  181. $proceed = TRUE;
  182. // passed data
  183. if(!empty($_POST['jid'])) {
  184. $jid = $_POST['jid'];
  185. } else {
  186. echo "Missing required data for \$_POST['jid']";
  187. $proceed = FALSE;
  188. }
  189. // post job
  190. if($proceed) {
  191. $response = $OBJ_linkedin->closeJob($jid);
  192. if($response['success'] === TRUE) {
  193. // job posted
  194. header('Location: ' . $_SERVER['PHP_SELF']);
  195. } else {
  196. // an error occured
  197. echo "Error closing job:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  198. }
  199. }
  200. break;
  201. case 'edit_job':
  202. /**
  203. * Handle job editing requests.
  204. */
  205. // check the session
  206. if(!oauth_session_exists()) {
  207. throw new LinkedInException('This script requires session support, which doesn\'t appear to be working correctly.');
  208. }
  209. // set the object
  210. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  211. $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
  212. // proceed flag
  213. $proceed = TRUE;
  214. // passed data
  215. if(!empty($_POST['jid'])) {
  216. $jid = $_POST['jid'];
  217. } else {
  218. echo "Missing required data for \$_POST['jid']";
  219. $proceed = FALSE;
  220. }
  221. if(!empty($_POST['jxml'])) {
  222. $xml = str_replace('&lt;', '<', str_replace('&gt;', '>', $_POST['jxml']));
  223. } else {
  224. echo "Missing required data for \$_POST['jxml']";
  225. $proceed = FALSE;
  226. }
  227. // post job
  228. if($proceed) {
  229. $response = $OBJ_linkedin->editJob($jid, $xml);
  230. if($response['success'] === TRUE) {
  231. // job posted
  232. header('Location: ' . $_SERVER['PHP_SELF']);
  233. } else {
  234. // an error occured
  235. echo "Error posting job:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  236. }
  237. }
  238. break;
  239. case 'initiate':
  240. /**
  241. * Handle user initiated LinkedIn connection, create the LinkedIn object.
  242. */
  243. // check for the correct http protocol (i.e. is this script being served via http or https)
  244. if($_SERVER['HTTPS'] == 'on') {
  245. $protocol = 'https';
  246. } else {
  247. $protocol = 'http';
  248. }
  249. // set the callback url
  250. $API_CONFIG['callbackUrl'] = $protocol . '://' . $_SERVER['SERVER_NAME'] . ((($_SERVER['SERVER_PORT'] != PORT_HTTP) || ($_SERVER['SERVER_PORT'] != PORT_HTTP_SSL)) ? ':' . $_SERVER['SERVER_PORT'] : '') . $_SERVER['PHP_SELF'] . '?' . LINKEDIN::_GET_TYPE . '=initiate&' . LINKEDIN::_GET_RESPONSE . '=1';
  251. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  252. // check for response from LinkedIn
  253. $_GET[LINKEDIN::_GET_RESPONSE] = (isset($_GET[LINKEDIN::_GET_RESPONSE])) ? $_GET[LINKEDIN::_GET_RESPONSE] : '';
  254. if(!$_GET[LINKEDIN::_GET_RESPONSE]) {
  255. // LinkedIn hasn't sent us a response, the user is initiating the connection
  256. // send a request for a LinkedIn access token
  257. $response = $OBJ_linkedin->retrieveTokenRequest();
  258. if($response['success'] === TRUE) {
  259. // store the request token
  260. $_SESSION['oauth']['linkedin']['request'] = $response['linkedin'];
  261. // redirect the user to the LinkedIn authentication/authorisation page to initiate validation.
  262. header('Location: ' . LINKEDIN::_URL_AUTH . $response['linkedin']['oauth_token']);
  263. } else {
  264. // bad token request
  265. echo "Request token retrieval failed:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  266. }
  267. } else {
  268. // LinkedIn has sent a response, user has granted permission, take the temp access token, the user's secret and the verifier to request the user's real secret key
  269. $response = $OBJ_linkedin->retrieveTokenAccess($_SESSION['oauth']['linkedin']['request']['oauth_token'], $_SESSION['oauth']['linkedin']['request']['oauth_token_secret'], $_GET['oauth_verifier']);
  270. if($response['success'] === TRUE) {
  271. // the request went through without an error, gather user's 'access' tokens
  272. $_SESSION['oauth']['linkedin']['access'] = $response['linkedin'];
  273. // set the user as authorized for future quick reference
  274. $_SESSION['oauth']['linkedin']['authorized'] = TRUE;
  275. // redirect the user back to the demo page
  276. header('Location: ' . $_SERVER['PHP_SELF']);
  277. } else {
  278. // bad token access
  279. echo "Access token retrieval failed:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  280. }
  281. }
  282. break;
  283. case 'post_job':
  284. /**
  285. * Handle job posting requests.
  286. */
  287. // check the session
  288. if(!oauth_session_exists()) {
  289. throw new LinkedInException('This script requires session support, which doesn\'t appear to be working correctly.');
  290. }
  291. // set the object
  292. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  293. $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
  294. // proceed flag
  295. $proceed = TRUE;
  296. // passed data
  297. if(!empty($_POST['jxml'])) {
  298. $xml = str_replace('&lt;', '<', str_replace('&gt;', '>', $_POST['jxml']));
  299. } else {
  300. echo "Missing required data for \$_POST['jxml']";
  301. $proceed = FALSE;
  302. }
  303. // post job
  304. if($proceed) {
  305. $response = $OBJ_linkedin->postJob($xml);
  306. if($response['success'] === TRUE) {
  307. // job posted
  308. header('Location: ' . $_SERVER['PHP_SELF']);
  309. } else {
  310. // an error occured
  311. echo "Error posting job:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  312. }
  313. }
  314. break;
  315. case 'renew_job':
  316. /**
  317. * Handle job renewal requests.
  318. */
  319. // check the session
  320. if(!oauth_session_exists()) {
  321. throw new LinkedInException('This script requires session support, which doesn\'t appear to be working correctly.');
  322. }
  323. // set the object
  324. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  325. $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
  326. // proceed flag
  327. $proceed = TRUE;
  328. // passed data
  329. if(!empty($_POST['jid'])) {
  330. $jid = $_POST['jid'];
  331. } else {
  332. echo "Missing required data for \$_POST['jid']";
  333. $proceed = FALSE;
  334. }
  335. if(!empty($_POST['cid'])) {
  336. $cid = $_POST['cid'];
  337. } else {
  338. echo "Missing required data for \$_POST['cid']";
  339. $proceed = FALSE;
  340. }
  341. // post job
  342. if($proceed) {
  343. $response = $OBJ_linkedin->renewJob($jid, $cid);
  344. if($response['success'] === TRUE) {
  345. // job posted
  346. header('Location: ' . $_SERVER['PHP_SELF']);
  347. } else {
  348. // an error occured
  349. echo "Error closing job:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  350. }
  351. }
  352. break;
  353. case 'revoke':
  354. /**
  355. * Handle authorization revocation.
  356. */
  357. // check the session
  358. if(!oauth_session_exists()) {
  359. throw new LinkedInException('This script requires session support, which doesn\'t appear to be working correctly.');
  360. }
  361. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  362. $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
  363. $response = $OBJ_linkedin->revoke();
  364. if($response['success'] === TRUE) {
  365. // revocation successful, clear session
  366. session_unset();
  367. $_SESSION = array();
  368. if(session_destroy()) {
  369. // session destroyed
  370. header('Location: ' . $_SERVER['PHP_SELF']);
  371. } else {
  372. // session not destroyed
  373. echo "Error clearing user's session";
  374. }
  375. } else {
  376. // revocation failed
  377. echo "Error revoking user's token:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response, TRUE) . "</pre><br /><br />LINKEDIN OBJ:<br /><br /><pre>" . print_r($OBJ_linkedin, TRUE) . "</pre>";
  378. }
  379. break;
  380. default:
  381. // nothing being passed back, display demo page
  382. // check PHP version
  383. if(version_compare(PHP_VERSION, '5.0.0', '<')) {
  384. throw new LinkedInException('You must be running version 5.x or greater of PHP to use this library.');
  385. }
  386. // check for cURL
  387. if(extension_loaded('curl')) {
  388. $curl_version = curl_version();
  389. $curl_version = $curl_version['version'];
  390. } else {
  391. throw new LinkedInException('You must load the cURL extension to use this library.');
  392. }
  393. ?>
  394. <html lang="en">
  395. <head>
  396. <title>Simple-LinkedIn Demo &gt; Jobs &gt; Posting</title>
  397. <meta charset="utf-8" />
  398. <meta name="viewport" content="width=device-width" />
  399. <meta name="description" content="A demonstration page for the Simple-LinkedIn PHP class." />
  400. <meta name="keywords" content="simple-linkedin,php,linkedin,api,class,library" />
  401. <style>
  402. body {font-family: Courier, monospace; font-size: 0.8em;}
  403. footer {margin-top: 2em; text-align: center;}
  404. pre {font-family: Courier, monospace; font-size: 0.8em;}
  405. </style>
  406. </head>
  407. <body>
  408. <h1><a href="../demo.php ">Simple-LinkedIn Demo</a> &gt; <a href="./jobs.php">Jobs</a> &gt; <a href="<?php echo $_SERVER['PHP_SELF'];?>">Posting</a></h1>
  409. <p>Copyright 2010 - 2011, Paul Mennega, fiftyMission Inc. &lt;paul@fiftymission.net&gt;</p>
  410. <p>Released under the MIT License - http://www.opensource.org/licenses/mit-license.php</p>
  411. <p>Full source code for both the Simple-LinkedIn class and this demo script can be found at:</p>
  412. <ul>
  413. <li><a href="http://code.google.com/p/simple-linkedinphp/">http://code.google.com/p/simple-linkedinphp/</a></li>
  414. </ul>
  415. <hr />
  416. <p style="font-weight: bold;">Demo using: Simple-LinkedIn v<?php echo LINKEDIN::_VERSION;?>, cURL v<?php echo $curl_version;?>, PHP v<?php echo phpversion();?></p>
  417. <ul>
  418. <li>Please note: The Simple-LinkedIn class requires PHP 5+</li>
  419. </ul>
  420. <hr />
  421. <?php
  422. $_SESSION['oauth']['linkedin']['authorized'] = (isset($_SESSION['oauth']['linkedin']['authorized'])) ? $_SESSION['oauth']['linkedin']['authorized'] : FALSE;
  423. if($_SESSION['oauth']['linkedin']['authorized'] === TRUE) {
  424. ?>
  425. <ul>
  426. <li><a href="#manage">Manage LinkedIn Authorization</a></li>
  427. <li><a href="../demo.php#application">Application Information</a></li>
  428. <li><a href="../demo.php#profile">Your Profile</a></li>
  429. <li><a href="#jobs">Jobs Posting API</a>
  430. <ul>
  431. <li><a href="#jobsPost">Post New Job</a></li>
  432. <li><a href="#jobsEdit">Edit Existing Job</a></li>
  433. <li><a href="#jobsRenew">Renew Existing Job</a></li>
  434. <li><a href="#jobsClose">Close Existing Job</a></li>
  435. </ul>
  436. </li>
  437. </ul>
  438. <?php
  439. } else {
  440. ?>
  441. <ul>
  442. <li><a href="#manage">Manage LinkedIn Authorization</a></li>
  443. </ul>
  444. <?php
  445. }
  446. ?>
  447. <hr />
  448. <h2 id="manage">Manage LinkedIn Authorization:</h2>
  449. <?php
  450. if($_SESSION['oauth']['linkedin']['authorized'] === TRUE) {
  451. // user is already connected
  452. $OBJ_linkedin = new LinkedIn($API_CONFIG);
  453. $OBJ_linkedin->setTokenAccess($_SESSION['oauth']['linkedin']['access']);
  454. ?>
  455. <form id="linkedin_revoke_form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="get">
  456. <input type="hidden" name="<?php echo LINKEDIN::_GET_TYPE;?>" id="<?php echo LINKEDIN::_GET_TYPE;?>" value="revoke" />
  457. <input type="submit" value="Revoke Authorization" />
  458. </form>
  459. <hr />
  460. <h2 id="jobs">Jobs</h2>
  461. <h3 id="jobsPost">Post New Job:</h3>
  462. <form id="linkedin_post_job_form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  463. <input type="hidden" name="<?php echo LINKEDIN::_GET_TYPE;?>" id="<?php echo LINKEDIN::_GET_TYPE;?>" value="post_job" />
  464. <textarea name="jxml" id="jxml" style="width: 100%; height: 30em;"><?php echo str_replace('<', '&lt;', str_replace('>', '&gt;', $job_post_template));?></textarea>
  465. <input type="submit" value="Post Job" />
  466. </form>
  467. <hr />
  468. <h3 id="jobsEdit">Edit Existing Job:</h3>
  469. <form id="linkedin_edit_job_form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  470. <input type="hidden" name="<?php echo LINKEDIN::_GET_TYPE;?>" id="<?php echo LINKEDIN::_GET_TYPE;?>" value="edit_job" />
  471. <input name="jid" id="jid" value="" />&nbsp;<label for="jid">Job ID</label>
  472. <textarea name="jxml" id="jxml" style="width: 100%; height: 30em;"><?php echo str_replace('<', '&lt;', str_replace('>', '&gt;', $job_edit_template));?></textarea>
  473. <input type="submit" value="Edit Job" />
  474. </form>
  475. <hr />
  476. <h3 id="jobsRenew">Renew Existing Job:</h3>
  477. <form id="linkedin_renew_job_form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  478. <input type="hidden" name="<?php echo LINKEDIN::_GET_TYPE;?>" id="<?php echo LINKEDIN::_GET_TYPE;?>" value="renew_job" />
  479. <input name="jid" id="jid" value="" />&nbsp;<label for="jid">Job ID</label>
  480. <input name="cid" id="cid" value="" />&nbsp;<label for="cid">Contract ID</label>
  481. <input type="submit" value="Renew Job" />
  482. </form>
  483. <hr />
  484. <h3 id="jobsClose">Close Existing Job:</h3>
  485. <form id="linkedin_close_job_form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
  486. <input type="hidden" name="<?php echo LINKEDIN::_GET_TYPE;?>" id="<?php echo LINKEDIN::_GET_TYPE;?>" value="close_job" />
  487. <input name="jid" id="jid" value="" />&nbsp;<label for="jid">Job ID</label>
  488. <input type="submit" value="Close Job" />
  489. </form>
  490. <?php
  491. } else {
  492. // user isn't connected
  493. ?>
  494. <form id="linkedin_connect_form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="get">
  495. <input type="hidden" name="<?php echo LINKEDIN::_GET_TYPE;?>" id="<?php echo LINKEDIN::_GET_TYPE;?>" value="initiate" />
  496. <input type="submit" value="Connect to LinkedIn" />
  497. </form>
  498. <?php
  499. }
  500. ?>
  501. </body>
  502. </html>
  503. <?php
  504. break;
  505. }
  506. } catch(LinkedInException $e) {
  507. // exception raised by library call
  508. echo $e->getMessage();
  509. }
  510. ?>