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
https://forums.phpfreaks.com/topic/192731-variables/#findComment-1015258
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
https://forums.phpfreaks.com/topic/192731-variables/#findComment-1015264
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
https://forums.phpfreaks.com/topic/192731-variables/#findComment-1015282
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.