Jump to content

[SOLVED] Linking / Variable


hazz995

Recommended Posts

You can't exactly do that in PHP. You can in JavaScript, but if that's not what you're looking for you can use the $_GET superglobal with similar functionality. Example:

 

<?php
$var = isset($_GET['var']) ? $_GET['var'] : 'Not set';
echo '$var is: ' . $var;
?>
<a href="?var=somethingelse">Click!</a>

You can't exactly do that in PHP. You can in JavaScript, but if that's not what you're looking for you can use the $_GET superglobal with similar functionality. Example:

 

<?php
$var = isset($_GET['var']) ? $_GET['var'] : 'Not set';
echo '$var is: ' . $var;
?>
<a href="?var=somethingelse">Click!</a>

 

Thanks a lot, I got the result I wanted.

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.