Jump to content

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.

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.