Quantcast
Channel: Sendy Forum
Viewing all articles
Browse latest Browse all 1418

Import from external URL into Body

$
0
0

in create.php just add this after line 163

<div class="input-append">
                          <input type="text" class="input-xlarge" id="import-uri" name="import-uri" placeholder="HTML para Importar"> <a id="import-now" href="#" class="btn" id="import_html">Importar HTML</a>
                          <script>
                          $("#import-now").click(function() {
                            var uri = $('#import-uri').val();
                            $.post('import-html.php', { uri: uri },function(data) {
                                              $('#html').html(data);
                                              alert(data);
                                            });
                                            return false;
                                        });
                          </script>
                        </div>

and then create a file called import-html.php and write this in it

<?php $url = $_POST['uri']; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $output = curl_exec($curl); echo $output; curl_close($curl) ?>

it's a quick way to add an "import from other site" field so you don't have to copy the source if you have a template generator


Viewing all articles
Browse latest Browse all 1418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>