You are invited to Log in or Register a free Frihost Account!

Add function for link page

I am thinking of adding a function to my links page. My links page just list websites divided into a number of categories, eg. music sites, games sites, etc. Its a simple page with just the listing.

Now, I want a function that would allow me to add sites to my links page directly from the page itself and not having to go into DA. So maybe a form that have inputs like website name, URL, category. It has to be exclusively for me only and not for any visitor to add links (to prevent abuse), so a password or something.

Once the information is inputed, it will appear immediately in the listing under the selected category.

I have zero knowledge of php, perl or script. Can someone please help me out?
Somebody will be able to help you. In the meantime however I suggest looking at my contact form. It gets information and emails it to me using a mail function. If you look at the syntax and just the general layout of the form you will be better prepared to understand what some smart cookie shows you. I don't know how to put the results of a form into a page so I can't help you there.

In the page you want to enter the data there is a form with the following html:
<form method="post" action="submit.php">
              <p>Your E-Mail:<br />         
                <INPUT TYPE="TEXT" NAME="email" size="40" >

Subject:<br />
<INPUT TYPE="TEXT" NAME="subject" size="40" >
<textarea name="message" cols="40" rows="8"></textarea>
                <input type="submit" value="Submit"></p>

Then there is a separate file with a .php extension. This receives the data and then decides what to do with it. In here there would be a a function to put it into another file.
<? //This line tells the server "PHP Code is Starting!"

//We need to get the values submitted to the form and save them.
// $blah = $_POST['email'];
// now $blah is set to whatever email is.

$subject = $_POST['subject'];
$email = $_POST['email'];
$message = $_POST['message'];

//These IFs check if everything is filled in.

if (!$email) { //if $email is blank and not filled in
echo "Please fill in the email field"; //tell the user to fill in the appropriate fields
die; //stop the PHP from continuing

if (!$subject) {
echo "Please fill in the subject field";

if (!$message) {
echo "Please fill in the message field";

//Now that we have checked that everything is filled in, LETS SEND THE EMAIL!
//We are going to use a simple function called mail().
// mail("EMAIL TO","SUBJECT","MESSAGE","From: name <email>");

mail("", $subject, "$email\n$message", "From: SCOTTY-CONTACT <>");

echo "Your message has been sent successfully, please press back to return to my site."; //now lets tell the user "your email was sent!"


Good luck!

Note: The reason I post this is because my form has good annotations (thanks to whoever wrote it, it came from the web somewhere). With that annotation you may be able to understand php just a little bit better.
Related topics
AJAX tutorial
Simulating the back button
[RESOLVED] How to add image or text to link in signature?
Help needed link/page checker
[IE7] Stylesheet Selection Support
link request
Database Privilege
Something crazy about IE javascript wew...
Abitur Page '07
add frihost link to my site? and
I will add your link to both my blog and my directory.
Add Your Link yourself
Work at home Directory. Add your link.
add your link for free (just a little cost)
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

© 2005-2011 Frihost, forums powered by phpBB.