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
https://forums.phpfreaks.com/topic/48084-php-extension/#findComment-235120
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
https://forums.phpfreaks.com/topic/48084-php-extension/#findComment-235196
Share on other sites

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.