Jump to content

[SOLVED] Encode/Decode question


subnet_rx

Recommended Posts

I'm pulling values from a database that has spaces in it.  I'm using urlencode to create the $_GET variables like this:

 

	    	while ($row = mysql_fetch_assoc($result)) 
	    	{
	    		echo "<li><a href=\"programs.php?c=".$_GET['c']."&d=".urlencode($row['Department'])."\">".$row['Department']."</a></li>";
	    	}

 

When I pull it back out, I'm using this:

 

$d = htmlspecialchars(urldecode($_GET['d']));

 

Is this the proper way to do this so I get the same exact value?  The problem I'm running into is any value with a ampersand (&) in it.

Link to comment
https://forums.phpfreaks.com/topic/65114-solved-encodedecode-question/
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.