Jump to content

Recommended Posts

im new to programming concepts

i need a walk through with this program --can someone please HELP.====================================

Assignment: Create a Visitor Book script to store visitor names and email addresses in a text file. Include the following to allow users to

 

      view the visitor book

    sort the visitor book by name

    delete duplicate entries (OPTIONAL)

 

You can either use a sticky form format or put the form in a separate HTML file.

 

 

Heres my html:=========================***********************************************%%%%%%%%%%%%%

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

    <title>BookScript</title>

    <meta http-equiv="Content-Type"

        content="text/html; charset=UTF-8" />

<meta name="Author" content="Armando" />

</head>

 

<body>

<form method="BookScript.php" method="post">

<p>Welcome to Book Script</p>

<hr>

<p>

<a href="BookScript.php?action=Sort%20Ascending">

    Sort Book List</a><br />

<a href="BookScript.php?action=delete">

    Delete Book</a><br />

</p>

<form action="BookScript.php?method="post">

 

<p>Add Book</p>

<p>Book Name: <input type="text" name="BookName"

    /></p>

<p><input type="submit" name="submit"

    value="Add Book to List" />

<input type="reset" name="reset"

    value="Reset Song Name" /></p>

</form>

</body>

</html>

 

Now here is my php:************************************************

<?php

this is where im having problems--i dont know what to do or code it---need help!!

 

i would greatly appreciate any and all help

 

?>

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/249123-php-code/
Share on other sites

You cannot write any code until you have broken down a problem into the individual steps necessary to solve that problem. For any particular action (adding a new entry to the guest book file), have you set down in front of an editor and thought about and made a list of steps you would do to accept the data from the form and save it into a text file stored on a computer?

 

You would then write the code necessary to perform each of those individual steps. For example, one of the steps might be to open and read through the existing content of the text file. You would then make use of the Filesystem function section in the php documentation (or more likely your instructor has covered the instructions he expects you to use) to find what functions exist that allow you to open and read the content of a file.

Link to comment
https://forums.phpfreaks.com/topic/249123-php-code/#findComment-1279336
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.