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
https://forums.phpfreaks.com/topic/101928-php-web-address/
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
https://forums.phpfreaks.com/topic/101928-php-web-address/#findComment-521639
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.