Jump to content

another dumb question


Yeodan

Recommended Posts

This is an example, the real situation is slightly more complicated.

 

I have a page with some links on it.

It's only a few at the moment, but it will grow to 50+ later.

 

index.php

<?php
echo "<a href='page1.php'>page1</a>";
echo "<a href='page2.php'>page2</a>";
?>

 

page1.php

<?php
echo "page1";
?>

 

page2.php

<?php
echo "page2";
?>

 

I was wondering wether it's possible to code 1 page to see wich link was clicked and changes the message according to that.

This method works too, but it might get a bit annoying if something has to be changed on the page (every page) and I have 50+

Link to comment
https://forums.phpfreaks.com/topic/151129-another-dumb-question/
Share on other sites

Why do you have 50+ there are techniques to slim down your number of pages.

 

For example you could add a variable on the end of your url:

echo "page1";
echo "page2";
?>

 

other_page.php

echo $_GET['page'];
?>

 

Hope that help, but you would have to explain your situation a little better for us to come up with a solid solution.

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.