Jump to content

Query Strings & Include()


Guest

Recommended Posts

Giving you an example; if you have a file called "header.php":

[code]<?php

echo 'Page: ' . $_GET['page'];

?>[/code]

Now if you access header.php?page=12 it will print out:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Page: 12[/quote]

But if you have another file, called another.php:

[code]<?php

include 'header.php';
echo 'Included!';

?>[/code]

And access another.php?page=15, it will print:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Page: 15
Included[/quote]
Link to comment
https://forums.phpfreaks.com/topic/12197-query-strings-include/#findComment-46544
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.