Jump to content

var in url


GRooVeZ

Recommended Posts

hi

 

i have this code, wich deletes u from a list

if succeeded it gives u a succes message, and forwards u to a page

 

like this

 

		$mes="<b>succes<br />";
	return success($mes,'./ffamatches.php');

 

this is working, now what i want is to put a var inthere

 

 

		$mes="<b>succes<br />";
	return success($mes,'./ffamatches.php?id=$matchid');

 

but thats not working, how do i do this?

 

this is the complete page

 

<?php

include("./includes/egl_inc.php");
$secure = new secure();
$secure->secureGlobals();
page_protect();

if($_SESSION['user']) 
{

	if (isset ($_GET['match'])) 
		{ 

			$matchid = (int)$_GET['match'];

		}elseif($match) 
		{ 

			$matchid = (int)$match;

		}

$playersidcheck = $_COOKIE['tid'];		

$deleteQuery = "DELETE FROM ffa_signups WHERE matchid='$matchid' and playerid='$playersidcheck'"; 

$deleteResult = mysql_query($deleteQuery) or die(mysql_error());

	$mes="<b>succes<br />";
	return success($mes,'./ffamatches.php');


}else{

header('Location: ./login.php');

}


include("$config");
?>

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/261267-var-in-url/
Share on other sites

when you use single quote (like <?php echo '$matchid'; ?>), so the output will be $matchid, not the value of the $matchid variable

 

You could use double quote (") or concatenate the string with this

 

success($mes,'./ffamatches.php?id=' . $matchid);

 

reference: http://www.trans4mind.com/personal_development/phpTutorial/quotes.htm

 

Link to comment
https://forums.phpfreaks.com/topic/261267-var-in-url/#findComment-1338867
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.