Website Babble Webmaster Forums  
  #1 (permalink)  
Old 05-17-2008, 07:27 PM
Junior Babbler
 
Join Date: Mar 2008
Posts: 25
Default Has anyone figured out...

A script that allows the user to upload content, such as a new page, to their site, and have it automatically add a link to the front page?
Reply With Quote
  #2 (permalink)  
Old 05-20-2008, 09:26 AM
Junior Babbler
 
Join Date: May 2008
Posts: 8
Default

Yes, that can be done, in many different ways, but you will need more than just a basic knowledge of PHP. I write many such scripts in my PHP programing.

If you need the person to upload contents such as photos and videos, then you need to use a form with a multipart/form-data attribute.

<form name="uploadafile" method="POST" action="uploadafile.php" enctype="multipart/form-data">

If it's just uploading an HTML text file you just might want to use a form with a simple text box and have your script just save the content of that text box into a filename the surfer chooses as well in that form.

Modifying the index page or any page that will get the link can be done by using HTML remark as tags (just insert your links within those tags.):

<!-- start links here --> <!-- end links here -->

The same script that receives the file can modify the index page to get the links. The script you write will look for these tags and parse the index file and add the new link in between those tags.

There are many ways to get this done but it will depend on how your website is structured. For example, perhaps there is a links file that holds the links and is included in the index page, in this case you add the links there.

Also, for HTML pages, you need to keep security in mind. What HTML is allowed on these pages? And what about java scripts? etc. A form like this should only be allowed in an admin panel and used by trusted users.

Do a search on google with keywords such as "forms" "uploads" "php". You should get plenty of tutorials.

Hope that helps.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 08:47 AM.



WB Sponsors

Profit Lance Review

affiliate network

Work At Home Jobs

Expert PPC Coaching



 Subscribe to the Website Babble Feeds

2 Create a Website Homepage | 2 Create a Website Blog


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0