WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Link Submition - Allow your visitors to submit links to the site.
Categories : PHP, Arrays, Filesystem, Beginner Guides Click here to Update Your Picture
Shashank Prabhakara
Date : May 30th 2009
Grade : 5 of 5 (graded 1 times)
Viewed : 3961
File : 4972.zip
Images : No Images for this code example.
Search : More code by Shashank Prabhakara
Action : Grade This Code Example
Tools : My Examples List

 
Like this code?
Show the author your appreciation.
Submit your own code examples 
 

Install Instructions.
---------------------

1) Add your information in the variables.php, which is fully commented to make
it easy for you. You should not have to change the first 2 variables. The other
variables are for the Page Title, Text and links above and below on the page.

2) Upload linklist.php, footer.php, header.php, submit.php, variables.php, index.php,
emails.txt and links.txt in ASCII mode to the directory /linklist. Then, upload
browser.gif to the directory /images in BINARY or Auto mode.

3) CHMOD emails.txt and links.txt 777.

3) Your done, to view your Link List page, go to www.yourdomain.com/links/index.php.
To add a link, go to www.yourdomain.com/links/submit.php.



footer.php
<center>
<br>
<font size="4">
<?php
echo $text3 ?>
<br>
<?php echo $text4 ?><br>
  <a href="<?php echo $url2 ?>" target=_blank">
  <?php
echo $urltext2 ?>
  </a></font> <br>
</center><br>
<div align="center"><a href="submit.php"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Click
  Here To Submit Your Site</font></a></div><br>
</html>




index.php
<?php
include "header.php";
?>
<?php
$data
= file('links.txt');
$data = array_reverse($data);
foreach(
$data as $element) {
   
$element = trim($element);
   
$pieces = explode("|", $element);
    echo
$pieces[2] . $pieces[1] . "" . $pieces[0] . "";
}
?>
<?php
include "footer.php";
?>




header.php
<?php
require "variables.php";
?>
<html>
<head>
<title><?php echo $title ?> </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body bgcolor="#006699" text="#FFFFFF" link="#FFFFFF" vlink="#FFFF00" alink="#FF0000"><font color="#FFFFFF" size="1" face="verdana">
<br>
<center><font size="4">
<?php echo $text1 ?>
<br>
<?php echo $text2 ?>
<br>
  <a href="<?php echo $url1 ?>" target=_blank">
  <?php
echo $urltext1 ?>
  </a><br></font>
</center><br>

<div align="center"><a href="submit.php"><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Click Here To Submit Your Site</font></a></div><br>




submit.php
<?php
require "variables.php";
?>
<html>
<head>
<title><?php echo $title ?> </title>
</head>
<body bgcolor="#006699" text="#FFFFFF" link="#FFFFFF" vlink="#FFFF00" alink="#FF0000">
<center><font size="4">
<?php
echo $text1 ?>
<br>
<?php echo $text2 ?><br>
<a href="<?php echo $url1 ?>" target=_blank">
<?php
echo $urltext1 ?>
</a><br>
  <font color="#000000">Submit you site for an Instant Free Listing</font></font>
</center> <FORM METHOD="POST" ACTION="linklist.php">
  <table width="500" border="0" align="center" cellpadding="2" cellspacing="2">
    <tr>
      <td><div align="right"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Website
          Name:</font></strong> </div></td>
      <td> <div align="left">
          <INPUT TYPE="text" NAME="wsname" SIZE="30">
        </div></td>
    </tr>
    <tr>
      <td width="105"><div align="right"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Website
          URL:</font></strong> </div></td>
      <td width="195"> <div align="left">no http:// just www.&nbsp;
          <INPUT TYPE="text" NAME="wsurl" SIZE="24">
        </div></td>
    </tr>
    <tr>
      <td><div align="right"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description:</font></strong></div></td>
      <td><textarea name="description" cols="26"></textarea></td>
    </tr>
    <tr>
      <td><div align="right"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Email:</font></strong></div></td>
      <td><input type="text" NAME="email"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><div align="center">By Submitting your link you agree to recieve mailings
          from us.<br>
          <INPUT TYPE="submit" value="Submit!">
        </div></div>
      </td>
    </tr>
  </table>
</form>

<center><font size="4">
<?php
echo $text1 ?>
<br>
<?php echo $text2 ?><br>
<a href="<?php echo $url2 ?>" target=_blank">
<?php
echo $urltext2 ?>
</a></font>
</center>
</html>




linklist.php
<?php
require "variables.php";
if (
$wsname == "") {
echo
"You must fill out a site name.";
exit;
}
else
if (
$wsurl == "") {
echo
"You must fill out a site URL.";
exit;
}
else
if (
$description == "") {
echo
"You must put a description.";
exit;
}
else
if (
$email == "") {
echo
"You must enter your email.";
exit;
}
else
$textfile = ("links.txt");
$textfile2 = ("emails.txt");
$fp = fopen($textfile, "a+");
fputs ($fp, "<center><table><tr><td bgcolor=666666 width=500 height=20><font size=2><img src=$imagedir/browser.gif><strong><a href=http://$wsurl target=_blank><font size=4>$wsname</font></a></strong></td></tr><tr><td bgcolor=cccccc width=400><font size=2><font color=000000>$description</font></td></tr></table></center><br><br>\n");
fclose($fp);
$fp = fopen($textfile2, "a+");
fputs ($fp, "$email\n");
fclose($fp);
echo
"<html> <title>$title</title><body bgcolor=006699 text=FFFFFF link=FFFFFF vlink=FFFF00 alink=FF0000><font color=FFFFFF size=3 face=verdana><br><center><br> $text1<br>$text2 <br><a href=\"$url1 \" target=_blank\">  $urltext1</a><br><br>Your site has been successfully added. <a href=$viewpage>Click here</a> to view the Link List page.</center></html>";
?>




variables.php
<?php

// This is the page where you will put your free for fall links on. This is a URL!
$viewpage = "index.php";

// The directory to where you will upload your images. DO NOT END WITH TRAILING SLASH!
$imagedir = "images";

// Website Title
$title = "Title Of Link Page";

// Text 1 for top of pages
$text1 = "Your Text Here";

// Text 2 for top of pages
$text2 = "Second Line of Text";

// Link for Top Of Page
$url1 = "http://www.yahoo.com";

//URL 1 Text
$urltext1 = "Text Of URL";

// Text 1 for bottom of pages
$text3 = "Your Text Here";

// Text 2 for bottom of pages
$text4 = "Second Line of Text";

// Link for Top Of Page
$url2 = "http://www.google.com";

//URL 1 Text
$urltext2 = "Text Of URL";
?>









Display list of files within current and subdirectories (recursively) showing each file as an anchored link and each directory as a category header.
Categories : Filesystem, Directories, Arrays, PHP
PHP based Contact email form with multiple recipients, text file based, supports departments.
Categories : PHP, Email, Beginner Guides, Filesystem
Form Submission Using Array's
Categories : PHP, HTML and PHP, Beginner Guides, Arrays
Human readable PHP password generator
Categories : PHP, Security, Beginner Guides, Arrays
A flat file counter
Categories : PHP, Cookies, Filesystem, Beginner Guides
Random text quote
Categories : PHP, Arrays, Beginner Guides
Variable serialization and unserialization. Loading and saving variable structures to and from file.
Categories : Arrays, Filesystem, Variables, Strings, PHP
Compare two texts and display a block of text with the differences between them.
Categories : PHP, PHP Classes, Filesystem, Strings, Arrays
This script will read all images from a folder and read the files into an array. It uses rand() to get a random number. It will display a random image from the image folder given.
Categories : PHP, Arrays, Graphics, Filesystem
Simple image counter
Categories : PHP, Graphics, Filesystem, Beginner Guides
Filling an array with files from any given directory. This example is for the current PHP script's directory.
Categories : PHP, Arrays, Filesystem
A function which places the path and name of all subdirectories into an array
Categories : PHP, Filesystem, Arrays, Directories
Grab images from one or more URLs and save them to a specified local directory.
Categories : PHP, Filesystem, Strings, Arrays
How to ifconfig down/up a list of IP's
Categories : Arrays, Strings, Filesystem, PHP
Creating a Language File
Categories : PHP, Beginner Guides, Filesystem