View Full Version : php code to click/visit urls submitted from forms?

12-23-2010, 12:56 AM
Hi guys,

Im a noob and I need some help. :o

First of all, good to be here.

I need help to create a simple php code that will click/visit all the urls I have entered on my forms. In other words, once I click submit button on my html form, it will then visit all the urls I entered earlier.

Help and guidance needed. Thanksss

12-23-2010, 01:46 AM
How are you thinking of doing this?

Will each url open up in a new tab/window or what?

You may need to give a little more information of what it is you want the code to do, we know you want a form for someone to enter in url's but how many url's are allowed and what will happen after they submit them like I said about about tabs/windows?

12-23-2010, 02:02 AM
Hi DJCMBear,

Thanks for replying. Sorry for the lack of info provided. :o

the new pages will open on the same tab of that form. Just some small little pages will do. But which is easier? To open it on new windows is easier or to open all the pages on same tab as the form?

Urls limitation, none.

12-23-2010, 02:29 AM
Well for one you cant open more than one url in a single tab/window unless you use frames on the page, now I would suggest something similar to this.

NOTE: Untested!

<?php # URL Opener - openURL.php
* This script will open all url's in separate frames
function OpenURL($arr) {
if(!empty($arr)) {
foreach($arr As $url) {
$frames[] = "<iframe src=\"{$url}\" class=\"URLFrame\"></iframe>";
return implode("",$frames);

$urls = OpenURL(split(',',$_POST['urls']));

print <<<FULLPAGE
<style type="text/css">
.URLFrame {
display: block;
width: 100%;
height: 600px;
<td>HTTP Address's (<sup>Split with commas ','</sup>)</td>
<form method="post" action="">
<input type="text" name="urls" />
<input type="submit" value=" Open " />
<td colspan="2">{$urls}</td>

12-23-2010, 03:02 AM
thanks! i will test it out. :)