[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating a Site Submit Script

Posted on 2009-02-14
12
Medium Priority
?
244 Views
Last Modified: 2013-12-08
Hi,

I am just wondering, I am thinking of creating a Site Search Submit Script. In other words something where people including myself can go to my website and type in their URL and have it submit it to a list of predefined search engines. Does anyone know if this can be done and how hard is it to do.

Kind Regards,
CompTeck2255
0
Comment
Question by:CompTeck2255
  • 7
  • 5
12 Comments
 
LVL 5

Expert Comment

by:BarsMonster
ID: 23644105
It is not hard at all. You need to know URL which does to work. For example:

http://www.coolsearchengine.com?site_to_add=Your_site

To automatically submit to this site in PHP, you may do:

file_content("http://www.coolsearchengine.com?site_to_add=".$_POST["user_entered_url"]);

That's it. Posting data via POST is a little harder but still easy (see CURL library)
0
 

Author Comment

by:CompTeck2255
ID: 23644149
Hi, BarsMonster

Thanks for the quick reply. This is great information how would I get this onto my server to display it to the end user.

Kind Regards,
CompTeck2255
0
 
LVL 5

Expert Comment

by:BarsMonster
ID: 23644166
Here is the mockup. Anyway, you should know PHP to customize it and make it work in your environment.

<h1>Submit your site to all known search engines</h1>
<form method="post" action="">
<input type="text" name="user_entered_url">
<input type="Submit">
</form>
<?
  if(isset($_POST["user_entered_url"]))
  {
   file_content("http://www.coolsearchengine.com?site_to_add=".$_POST["user_entered_url"]);
header("Location: /site_submitted.php");
exit;
}
?>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:CompTeck2255
ID: 23644186
Ok greats thanks, Now that will submit the website that they enter in to the Search Engines that I input correct? If so how can I add more to it.

Thanks :)
0
 
LVL 5

Accepted Solution

by:
BarsMonster earned 1500 total points
ID: 23644191
You need to figure out submission urls and duplicate this line with different submission urls:

 file_content("http://www.coolsearchengine.com?site_to_add=".$_POST["user_entered_url"]);
0
 

Author Comment

by:CompTeck2255
ID: 23644200
Great, Thanks for you help on this matter, I shall get back to you if I have any issues.
0
 

Author Comment

by:CompTeck2255
ID: 23644364
Hi,

I seem to be getting this error when I enter in a url like http://site.com.au 

Fatal error: Call to undefined function file_content() in /home/eva50119/public_html/new 2.php on line 16

Any ideas
0
 
LVL 5

Expert Comment

by:BarsMonster
ID: 23645615
Sorry, correct name is file_get_content :-)
0
 

Author Comment

by:CompTeck2255
ID: 23646700
Hi

This is the code that I have so far. But I am still getting this error
Fatal error: Call to undefined function file_get_content() in /home/eva50119/public_html/new 2.php on line 16

Do you know what is causing this. Will this work as Google and the other ones that I hope to use all use CAPTURA Verification before you can submit it.

Kind Regards,
CompTeck2255


<h1>Submit your site to all known search engines</h1>
<form method="post" action="">
<input type="text" name="user_entered_url">
<input type="Submit">
</form>
<?
 if(isset($_POST["user_entered_url"]))
 {
file_get_content("http://www.google.com/addurl/?continue=/addurl".$_POST["user_entered_url"]);
header("Location: /site_submitted.php");
exit;
}
?>

Open in new window

0
 

Author Comment

by:CompTeck2255
ID: 23646702
Sorry above there is no line 16 that is because I had some other customizations to it in there the file has now been reuploaded without the modifications now here is the new line.

Fatal error: Call to undefined function file_get_content() in /home/eva50119/public_html/new 2.php on line 9
0
 
LVL 5

Expert Comment

by:BarsMonster
ID: 23646703
Try latest PHP, probably yours is older than 4.3 or url_fopen is restricted (many shared hosting companies restrict external calls).

For captcha - check recaptcha.com, also you may find examples of integrating captcha in google, they are not that small to write here :-)

0
 

Author Closing Comment

by:CompTeck2255
ID: 31547049
Hi,

Thanks for the help. It was much appreciated :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question