vblk 0 Report post Posted February 4, 2006 Dear Anybody, I'm going to start a website (on Xisto) which will give away free VB source code. Now i hav got a list of all the Projects and have written them all on the web. But i want a visitor to be able to click on a certain heading ofa project and then he/she will be taken to a automated page giving all the projects description and letting him/her download it. Now the problem is that i WILL NOT BE ABLE to type a whole page for each and every project i'm going to give out. I know that comercial websites use asp or php to automatically make the same page display different info according to the heading earilier clicked. Mind you i have made a mysql database on all the projects. I anyone actually understands what i mean please reply or point me in the right direction.Thank You,VBLK Share this post Link to post Share on other sites
moldboy 0 Report post Posted February 4, 2006 You want to do that?Okay, try this, when you build your page leave sections open for content, So if you plan on having three pieces of informaiton say file name, file size, and description then build the html page as such, but rather then filling in that informaitn echo php variables as such $name, $size, and #desc in the respective spots.No near the top of your page use the code: <?phpif (isset($_GET['id'])){//this checks to see if you have specified a page/*now I don't know how to assecc a database but basiacly in your database have a coloum that is called id, now here's where you search for a row which contains the value in the id coloum that is = to $_GET['id'].this is the value of a sent variable*/};else {echo "I'm sorry no file was specified";}?>now it's as simple as telling your page to take the values from the database and present them in the proper variables. To make a link to the right page link to thispagesname.php?id=the_page_number.If my code gives syntax errors I'm sorry didn't have time to check it. Share this post Link to post Share on other sites
Yarrgh 0 Report post Posted February 6, 2006 (edited) I know the basic idea was posted before but maybe I could help a bit more. <?php//check to see if they are trying to view a certain projectif (isset($_GET["id"])) { $id = $_GET["id"]; // Connect to the mysql and select the database mysql_connect ( "HOST" , "USERNAME" , "PASSWORD" ); mysql_select_db( "DATABASE" ); // Get the data from the database $a = mysql_query ( "SELECT * from `PROJECTS` WHERE `id`='".$id."'"); // Put the info into an array for easy use $info = mysql_fetch_array($a);}else { // Some other code to list the projects}?> Basically the only thing I expanded on is actually connecting to the database and pulling the information into an array.First off, replace HOST, USERNAME, PASSWORD, DATABASE with the correct info. Also replace PROJECTS with the table that the projects are in. I do not know what the host, your username, pasword, database, or the table they are in.To use the array the information is in, simply type $info["whatever"].Lets say you wanted to get the name, description, and the link to download the project. Use $info["name"], $info["description"], and $info["link"]. Of course the fields might be different depending on what you named each of the fields in your table.If you need any more help. I'll be more than happy to help. Edited February 6, 2006 by Yarrgh (see edit history) Share this post Link to post Share on other sites
EJay 0 Report post Posted February 6, 2006 (edited) Dear Anybody, I'm going to start a website (on Xisto) which will give away free VB source code. Now i hav got a list of all the Projects and have written them all on the web. But i want a visitor to be able to click on a certain heading ofa project and then he/she will be taken to a automated page giving all the projects description and letting him/her download it. Now the problem is that i WILL NOT BE ABLE to type a whole page for each and every project i'm going to give out. I know that comercial websites use asp or php to automatically make the same page display different info according to the heading earilier clicked. Mind you i have made a mysql database on all the projects. I anyone actually understands what i mean please reply or point me in the right direction. Notice from KuBi: Posting the same thing 18 times is..er..not needed. If this is an official test you should've stated so. Please PM me with an explanation. Warning Issued. Notice from cmatcmextra: This post is an exact copy of the first! Quoted. Edited February 6, 2006 by cmatcmextra (see edit history) Share this post Link to post Share on other sites
vblk 0 Report post Posted February 6, 2006 Hey Thanks Ejay, Yarrgh and Mold Boy. You guys really helped me alot and i learned alot. By the way (NO Ofence Intended ) whats that last message telling about posting the same thing 18 times and who did that guy warn? I know i didn't get any! Share this post Link to post Share on other sites
Yarrgh 0 Report post Posted February 8, 2006 He copied your first post over and over. Probably just to build up hosting credit. He was warned for spamming by the staff Share this post Link to post Share on other sites