Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.
Permalink
3d88e69369
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
25 lines (24 sloc) 970 Bytes
<?php
if($_POST['test']=='foo'){
echo '<p><strong>It worked! It worked! Igor, fetch me a brain!</strong></p>';
}
if(!preg_match('/icant/',$_SERVER['HTTP_HOST'])){
echo '<h1>Testing...</h1>';
echo '<p>Trying to post some content and such...</p>';
$apiendpoint = 'http://icant.co.uk/geomaker/test.php';
$post = 'test=foo';
$ch = curl_init($apiendpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$results = curl_exec($ch);
curl_close($ch);
echo $results;
echo '<p>Trying to do some XML stuff, below you should see an object representation.</p>';
$xml = simplexml_load_string('<starwars><chewie>Huurrrrrrrrrrr</chewie><hansolo>I know!</hansolo><leia>Aren\'t you a little small for an XML file?</leia></starwars>');
echo '<pre>';
print_r($xml);
echo '</pre>';
echo '<p>Has it worked? If so, Mazeltov, get <a href="index.php">get GeoMaking</a>.</p>';
}
?>