unplugged_web Posted July 25, 2008 Share Posted July 25, 2008 I'm trying to write a curl function that will take the the information (name and number) from a form and send them to a remote url then send the user to the next page. I've never used curl before so would be grateful for any help that you can give.From my understanding I would need something like <?php$name = strval($_GET['name']);$number = substr($_GET['number'],1);$ch = curl_init();curl_setopt($ch, CURLOPT_URL,"http://www.remoteurl.com/results.php?password=1234&name=$name&number=44$number");curl_setopt($ch, CURLOPT_GET, 1);curl_setopt($ch, CURLOPT_GETFIELDS);//result$result = curl_exec($ch);curl_close($ch);?> The form looks like this: <form action="" method="get" name="user" id="user" onSubmit="MM_validateForm('number','','RisNum');return document.MM_returnValue">Please your name. <br> <br><label> <br /> <label>Name <input type="text" name="name" id="name" /> </label> <br /><label>Number<input type="text" name="number" id="number" /> </label> <br /><input name="submit" type="submit" /> </form> but how do I incorporate the curl into the form and then send the user to the next page?Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted July 25, 2008 Share Posted July 25, 2008 You already have the code for curl, after that you can use a header to redirect them or just show what you want to show. Using curl isn't going to take them to that page. Link to comment Share on other sites More sharing options...
unplugged_web Posted July 28, 2008 Author Share Posted July 28, 2008 You already have the code for curl, after that you can use a header to redirect them or just show what you want to show. Using curl isn't going to take them to that page.Great thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.