Deivas Posted February 20, 2010 Share Posted February 20, 2010 Hi, I am trying to make a website, and I watched millions of php videos, and I don't get how to make it like: http://localhost/StuffOnline/servers.php?websites but not just http://localhost/StuffOnline/servers.php (I think they are variables). Can anyone please explain? Quote Link to comment Share on other sites More sharing options...
teamatomic Posted February 20, 2010 Share Posted February 20, 2010 Sorry, I dont have /StuffOnline/servers.php on my localhost so am unable to view whatever it is you have on your localhost. Is there an online version of it somewhere. HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
Deivas Posted February 20, 2010 Author Share Posted February 20, 2010 http://darkdrift.net/lol/htdocs/StuffOnline/servers.php (this is not my website, my friend hosted it for me) there. Quote Link to comment Share on other sites More sharing options...
Deivas Posted February 20, 2010 Author Share Posted February 20, 2010 <!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> Quote Link to comment Share on other sites More sharing options...
teamatomic Posted February 20, 2010 Share Posted February 20, 2010 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 Quote Link to comment Share on other sites More sharing options...
Deivas Posted February 20, 2010 Author Share Posted February 20, 2010 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.