Jump to content

using .php?something code?? Help!


tfenrich

Recommended Posts

There are several ways of doing this,

the simplest would be to use the $_GET method:

 

Eg.

index.php?q=Hello%20World

<?php
echo $_GET['q']; //Will return Hello World
?>

 

You can also do it by simple setting the query string into an array:

Eg,

index.php?Hello,World

<?php
$array = explode(",", $_SERVER['QUERY_STRING']);
$string = implode(" ", $array);
echo $string;
?>

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.