Jump to content

Variables?


Deivas

Recommended Posts

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <link rel="stylesheet" href="./style.css" type="text/css"/>
    <title>Online Servers | Top list</title>

    <body>

        <?php
        include './includes/banner.php';
        include './includes/menu.php';
        ?>

        <div id="content">
            <table id="content" width="86%" align="left">
                <tr>
                    <td><h1>Top List</h1><p>

                        <form name="form1" action="servers.php" method="post">
                            Please choose a type:
                            <select name="type">
                                <option value="website">Webistes</option>

                            </select><br/>
                            <input type="submit" value="Continue"/>
                        </form>
                        <hr/>
                        <?php
                        include 'connect.php';
                        $type = $_POST['type'];

                        $sitequery  = "SELECT * FROM site ORDER BY votes DESC";
                        $siteresult = mysql_query($sitequery);

                        if($type == website) {
                            return $site;
                            while($row = mysql_fetch_array($siteresult, MYSQL_ASSOC)) {
                                echo "
                                Name : {$row['sitename']}</a> <br>" .
                               "URL : {$row['siteurl']} <br>" .
                               "Short description : {$row['shortdetails']} <br>" .
                               "Votes : {$row['votes']} <br><hr><br>";
                            }

                        }
                        ?>

                </tr>
            </table>
        </div>
    </body>
</html>

Link to comment
Share on other sites

You need a few things. A database with the table to hold the data for the "websites". A form to add "websites" to the table. A page to display the data from the database table.

 

I would start with the database/table and populate it manually with a few rows. Then I would move on to a page to display it. Once that works I would make another page that has a form and the code to add the data to the database/table. Then I would think about some type of registration/administration page for the whole thing.

 

Then seeing as this seems to be your first website/application I would figure out all the things it does and doesnt do and how I would make it better and then start over again.

 

 

HTH

Teamatomic

Link to comment
Share on other sites

You need a few things. A database with the table to hold the data for the "websites". A form to add "websites" to the table. A page to display the data from the database table.

 

I would start with the database/table and populate it manually with a few rows. Then I would move on to a page to display it. Once that works I would make another page that has a form and the code to add the data to the database/table. Then I would think about some type of registration/administration page for the whole thing.

 

Then seeing as this seems to be your first website/application I would figure out all the things it does and doesnt do and how I would make it better and then start over again.

 

 

HTH

Teamatomic

 

I have a database, a page to add websites, and a website to show the websites is http://darkdrift.net/lol/htdocs/StuffOnline/servers.php , as you can see it says "Please choose a type:" you choose a type from the select box and click "Continue" and then a list of websites show up. But when someone clicks on "Continue" I want the link to change to http://darkdrift.net/lol/htdocs/StuffOnline/servers.php?type=websites or something, and when I will finish that I will make it so if someone clicks on the name it will redirect to a page and it will show then information about the website, and the site will be something like: http://darkdrift.net/lol/htdocs/StuffOnline/servers.php?type=websites;id=4523

Link to comment
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.