Jump to content

PHP Web Address


chordsoflife

Recommended Posts

So I'm trying to make my own PHP CMS by using a few tutorials on A List Apart, but I don't understand what's going on.

 

Can anyone explain how to/what is the "?=" thing in the link? I've split everything and included everything, yet nothing is dynamic. I still have to hand code every page. I think I just don't understand the concept and it seems to be left out. What don't I get?

Link to comment
Share on other sites

Those are variables. You can use those to pass information to a page (using $_GET) to do database queries or affect other code on the page.

 

For example, if I wanted to make something that displays a news article, my URL may look like

 

article.php?id=15

 

then in my page I will have code like

 

mysql_query("SELECT * FROM news WHERE ID = '".$_GET['id']."'") or die(mysql_error()); 

 

That will make my query dynamic, only selected the record with an ID of what I want at the time.

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.