If all else fails, split on the &.

$url = split("&", $_SERVER["REQUEST_URI"]);
$args = $url[0];


Steve B. wrote:

I have an online tutorial build into a web page.
It has button next step.
If you are on page index.php?abc=123 for instance
the code is smart enough to make it index.php?abc=123&step=x

The problem is how to remove step=x from the old url string so that steps don't pile 
I'm trying ereg but could use a nudge with the wild card aspect of searching and 

The code below builds the get string.

$stepnum = $_GET["step"];


$args = $_SERVER["REQUEST_URI"];
if ($_SERVER["argc"]>0) $args.="&";
else $args.="?";

if ($stepnum>1)
echo "<br><a href='$args";
echo "step=1'>step 1</a><br>";

if ($laststep>0)
echo "<br><a href='$args";
echo "step=$laststep'>backup 1 step</a><br>";

echo "<br><a href='$args";
echo "step=$nextstep'>next step</a><br>";


__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to