php - Get Value From Textbox to File_get_contents -
<div class="form-group"> <label for="inputsm">put url</label> <input class="form-control input-sm" id="inputsm" type="text"> <br> <input type="submit" class="btn btn-info" value="count contact"> </div>
this code text box , button
<?php $gettext = file_get_contents("", true); $contact = substr_count($gettext ,"contactid"); print_r($contact); ?>
and code php value , count
example
i need put link https://s3-ap-southeast-1.amazonaws.com/cloudpoc2/us-east-1%3a4502ecdd-1994-40da-8eb2-b6ccc96d6be0/contacts/contact_2014_11_19_09_53_28_278.vcf in text box , click button show number of contact in file
$gettext = file_get_contents("https://s3-ap-southeast-1.amazonaws.com/cloudpoc2/us-east-1%3a4502ecdd-1994-40da-8eb2-b6ccc96d6be0/contacts/contact_2014_11_19_09_53_28_278.vcf", true);
you have submit form through post or get. example use post. must assign name elements you're posting (such url). untested, may have errors. give idea.
<?php if(isset($_post['submit'])){ $url = $_post['url']; $gettext = file_get_contents("$url", true); $contact = substr_count($gettext ,"contactid"); print_r($contact); } ?> <form method="post" action="?"> <div class="form-group"> <label for="inputsm">put url</label> <input name="url" class="form-control input-sm" id="inputsm" type="text"> <br> <input name="submit" type="submit" class="btn btn-info" value="count contact"> </div> </form>
Comments
Post a Comment