moiisam10 Posted August 10, 2015 Share Posted August 10, 2015 Hello, am new to the forum. I want to grow as php coder and try to learns as much as possible, thanks for all.. Look i need some help triying to use my CURL code with a php text box.. The problem is that i parse the textbox to url by javascript function. <?php $url = "?nie="; ?> <script type="text/javascript"> function doStuff() { window.location.href="?nie="+encodeURIComponent(document.getElementById('tb1').value); } </script> <form action="" method="post"> <input type="text" id="tb1"> <input type="button" value="Buscar" onclick="doStuff()"> </form> but i need to parse that url to the CURL url. $url = "?nie="; $ch=curl_init(); $timeout=5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Get URL content $lines_string=curl_exec($ch); // close handle to release resources curl_close($ch); //output, you can also save it locally on the server echo $lines_string; ?> in the URL, the "?nie=" part is the value of the textbox.. the problem is.. If i put in the textbox 12464883 i need to put 12464883 in the "?nie="... Thanks in advanced and sorry for my bad english i am from venezuela.. Thanks to all Link to comment https://forums.phpfreaks.com/topic/297714-curl-help/ Share on other sites More sharing options...
moiisam10 Posted August 11, 2015 Author Share Posted August 11, 2015 Solved with this. .$_POST['tb1']; Thanks in advanced. Link to comment https://forums.phpfreaks.com/topic/297714-curl-help/#findComment-1518449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.