Home arrow PHP arrow Page 2 - Using PHP to Generate a Customized Google XML Sitemap

The Web Form's HTML Code - PHP

Submitting XML sitemaps to Google Webmaster Tools is an important webmaster activity. Google recommends using it to help it find new content in your website which otherwise cannot be crawled by Googlebot. This is particularly helpful if you have a fairly large website. In this article, you'll learn how to generate such a sitemap with PHP.

TABLE OF CONTENTS:
  1. Using PHP to Generate a Customized Google XML Sitemap
  2. The Web Form's HTML Code
  3. The PHP Server Side Script
  4. Implementation Guide
By: Codex-M
Rating: starstarstarstarstar / 4
June 16, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Let's create the easy coding for the web form, which will be used to get URL inputs from the users.

Note: the blue font color is for the code discussion or description.

//Start session for captcha or security code

 

<?php

session_start();

?>

 

<!--Start the head tag as well as display the page title-->

 

<html>

<body>

<head>

<title>PHP XML sitemap code generator</title>

</head>

 

<?php

 

//Check if the form is submitted

 

if (!$_POST['submit'])

{

 

//If the web form is not submitted, display the web form

 

?>

 

<!--This is the actual web form-->

 

<br />

 

<!--This form will submit the data to itself using PHP SELF-->

 

<form action="<?php echo $SERVER['PHP_SELF']; ?>"

method="post">

<font face="Verdana" size="2">

 

<!-Below is the form content, instructions on how to use-->

 

<!--You can enter any content here for your own web application, a sample content is shown in the screenshot below-->

 

<!--The Text area HTML code which will accepts user inputs in terms of URL-->

 

<!--It also includes the captcha or the security code-->

 

<textarea name="url" rows="18" cols="120"></textarea>

<br /><br />

<img src="/xmlsitemapgenerator/antibot.php" />

<br />

Type the anti-bot code above:

<br /> <br />

<input type="text" name="captcha" size="10">

<br /> <br />

<input type="submit" name="submit" value="Generate Sitemap XML code">

</form>

<a href="/xmlsitemapgenerator/xmlsitemapgenerator.php">Click here to reset or clear this form</a> 

The above is the complete web form code. An example of the completed form should look like this:



 
 
>>> More PHP Articles          >>> More By Codex-M
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: