Jump to content

PHP Extension


Stunt

Recommended Posts

<?php
if ($_GET['dw3'] == "story") { $site = "dw3story.php";}
elseif ($_GET['dw3'] == "artwork") {$site = "dw3artwork.php";}

include("$site");
?>

 

I guess this actually isn't what wanted.

But of what I know there's no automatic way to find what variable that are used, with what value in.

 

So I guess you need to make 2 $_GET[]'s like:

http://siteexample.com/?dw=3&page=Artwork

Link to comment
Share on other sites

Wrong Forum But I Have A JavaScript Method Aswell

 

<script type="text/javascript">
function getValue(varname)
{
  var url = window.location.href;
  var qparts = url.split("?");
  if (qparts.length == 0)
  {
    return "";
  }
  var query = qparts[1];
  var vars = query.split("&");
  var value = "";
  for (i=0;i<vars.length;i++)
  {
    var parts = vars[i].split("=");
    if (parts[0] == varname)
    {
      value = parts[1];
      break;
    }
  }
  value = unescape(value);
  value.replace(/\+/g," ");
  return value;
}
</script>
<script type="text/javascript">
var dw3 = getValue("dw3");

if(dw3 == "story"){
document.write('Content Here')
}
if(dw3 == "artwork"){
document.write('Content Here')
}
else
document.write('Error')
</script>

 

Link to comment
Share on other sites

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.