A Really Big Problem In Php Codin - Please help me i'm a starter

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

A Really Big Problem In Php Codin - Please help me i'm a starter

vblk
Dear Anybody,
I'm going to start a website (on trap17) 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 smile.gif smile.gif

Reply

moldboy
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:
CODE

<?php
if (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.

 

 

 


Reply

Yarrgh
I know the basic idea was posted before but maybe I could help a bit more.

CODE

<?php


//check to see if they are trying to view a certain project

if (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.

Reply

EJay
QUOTE
Dear Anybody,
I'm going to start a website (on trap17) 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.

Reply

vblk
Hey Thanks Ejay, Yarrgh and Mold Boy. You guys really helped me alot and i learned alot. By the way (NO Ofence Intended huh.gif ) 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! biggrin.gif biggrin.gif

Reply

Yarrgh
He copied your first post over and over. Probably just to build up hosting credit. He was warned for spamming by the staff

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : php codin starter


    Looking for big, problem, php, codin, im, starter

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for big, problem, php, codin, im, starter

*MORE FROM TRAP17.COM*
advertisement



A Really Big Problem In Php Codin - Please help me i'm a starter



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE