Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('wp-blog-header.php'); // ensures we can use Wordpress functions and db access
- if(isset($_REQUEST['code'])):
- query_posts( array(
- 'post_type' => 'post',
- 'meta_key' => 'barcode',
- 'meta_value' => $_REQUEST['code'],
- 'meta_compare' => '='
- ) );
- if (have_posts()) :
- while (have_posts()) : the_post();
- $url = get_permalink() ;
- wp_redirect($url);
- endwhile;
- else :
- echo '<p style="font-size:64px;">No entry for game '.$_REQUEST["code"].' exists yet</p>';
- endif;
- else:
- echo "<a href='p2spro://configure?lookup=http%3A//ipadboardgames.org/barcode.php?code=CODE'>Click here to configure your copy of scan2shop automatically</a>";
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement