Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to make redirect that includes data about the link that was clicked?
    primarykey
    data
    text
    <p>I have a page with two links (text link &amp; banner link), that should lead to the <strong>same</strong> redirect page<br> (on my domain). </p> <p>The redirect would be to a link that shall include a variable,<br> that indicates which of the two link was clicked.</p> <p>e.g.:</p> <pre><code>&lt;?php header("Location: http://external-domain.com/?ref=[value]"); die(); ?&gt; </code></pre> <p>wheareas the "value" should be "text" / "banner" or something similar.</p> <p>How can I do this? I'm not a web programmer at all so I don't have much technical knowledge,</p> <p>I guess <strong>one possible solution (which I would rather avoid)</strong> would be to give a separate id for the text link and for the banner, e.g.:</p> <p>text link: </p> <pre><code> http://mydomain.com/redirect.php?id=text </code></pre> <p>banner link: </p> <pre><code> http://mydomain.com/redirect.php?id=banner </code></pre> <p>whereas redirect.php would contain:</p> <pre><code>&lt;?php $source = $_GET['id'] ?&gt; &lt;?php header("Location: http://external-domain.com/?ref=&lt;?php print $source; ?&gt;"); die(); ?&gt; </code></pre> <p>But that would mean that I have to use a <strong>different</strong> id for these internal links;<br> I would rather find a way to use the <strong>same</strong> exact internal links (maybe for example, have each link in a "div" or a "class" and get the div/class name somehow, and have them appear as the [value].</p> <p>*<strong>EDIT:</strong> Let me emphasize again: I'm looking for a way to do this <strong>without having to use any "?id=[something]"</strong> at the end of the text link or the banner link.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload