zackcez Posted July 30, 2008 Share Posted July 30, 2008 Well here's my initial form: echo"<form action=\"index.php?pageid=products&do=done\" method=\"post\" name=\"vbform\" onsubmit=\"return form_continue();\" id=\"prodform\">"; echo"<table class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\">"; echo"<tr><td class=\"thead\">Licence Information</td></tr>"; echo"<tr><td class=\"panelsurround\" align=\"center\"><div class=\"panel\">"; for ($counter = 1; $counter <= $quantity; $counter += 1) { echo"<div align=\"left\"><fieldset class=\"fieldset\"><legend>" . $product['name'] . " License #$counter</legend> <div class=\"smallfont\">Web Site URL:<br /><input type=\"text\" size=\"30\" name=\"url_$counter\" value=\"http://\" /></div> <div><input id=\"install_service_$counter\" type=\"checkbox\" name=\"install_$counter\" value=\"1\" /> <label for=\"install_service_7-1\">Installation Service ($1.99)</label></div> <div><input id=\"branding_free_$counter\" type=\"checkbox\" name=\"copy_$counter\" value=\"1\" /> <label for=\"branding_free_7-1\">Copyright Removal ($3.99)</label></div></fieldset></div>"; } echo"<input type=\"hidden\" name=\"qan\" value=\"$quantity\">"; echo"</td></tr></div>"; echo"<div align=\"center\" id=\"please_wait\" style=\"display:none; margin-top:6px\"> <img style=\"vertical-align: middle;\" src=\"/images/misc/progress.gif\" alt=\"Checking URL\" id=\"wait_img\" /> <strong>Processing - Please Wait</strong></div></td></tr> <tr><td align=\"center\" class=\"tfoot\"><input class=\"button\" type=\"submit\" value=\"Continue\" /></td></tr></form></td></tr></table>"; And here's my done page: $qan = $_POST['qan']; for ($counter = 1; $counter <= $qan; $counter += 1) { $install = $_POST['install_$counter']; $copyright = $_POST['copy_$counter']; $url = $_POST['url_$counter']; $valid = @fsockopen("$url", 80, $errno, $errstr, 10); if (!$valid) { echo "$url is not valid; therefore was not registered!<br>"; } else { echo "$url is valid; therefore has been registered!<br>"; } } It always returns that it is NOT valid, even when it is, if anyone has a suggestion or knows how to fix this I'd appreciate it Quote Link to comment https://forums.phpfreaks.com/topic/117269-fsock-and-foreach/ Share on other sites More sharing options...
mbeals Posted July 30, 2008 Share Posted July 30, 2008 first off change: $valid = @fsockopen("$url", 80, $errno, $errstr, 10); to $valid = fsockopen("$url", 80, $errno, $errstr, 10); and put: echo "Error $errno: $errstr"; at the end. Quote Link to comment https://forums.phpfreaks.com/topic/117269-fsock-and-foreach/#findComment-603242 Share on other sites More sharing options...
zackcez Posted July 30, 2008 Author Share Posted July 30, 2008 Warning: fsockopen() [function.fsockopen]: unable to connect to :80 in [path]\modules\products\index.php on line 168 Error 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Quote Link to comment https://forums.phpfreaks.com/topic/117269-fsock-and-foreach/#findComment-603256 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.