...

View Full Version : $_get



Tulungo
01-22-2010, 05:01 PM
I have a problem with the $_GET
i'm sending like this:

print "\t<td><div align=center><a href=\"Base_actualiza1_cadastro1.php?menu1=$FirstName\" onClick='showPopup(this.href);return(false);'>".$FirstName."</a></div></td>\n";

<script type="text/javascript">
function showPopup(url) {
newwindow=window.open(url,'name','height=500,width=620,top=200,left=300,scrollbars=no');
if (window.focus) {newwindow.focus()}
}
</script>


And i get it:

$nome =$_GET['menu1'];

But the problem is if the ?menu1=A. FERREIRA PEDRO & IRMÃO

It only echo= A. FERREIRA PEDRO
:mad:
But in the URL it Apears A. FERREIRA PEDRO & IRMÃO


Can please someone help me

kbluhm
01-22-2010, 05:07 PM
Ampersands are used in building query strings:


?name=John&zip=12345

Yields:


$_GET['name']; // `John`
$_GET['zip']; // `12345`


So this query string:


?menu1=A. FERREIRA PEDRO & IRMÃO

Will come out looking something like:


$_GET['menu1']; // `A. FERREIRA PEDRO `
$_GET[' IRMÃO']; // empty string


have a look at:
http://www.php.net/urlencode
http://www.php.net/urldecode

mlseim
01-22-2010, 05:13 PM
The & symbol signifies the next variable in the URL.

Try &amp; (for ampersand) and see if that works.
Even though there's a "&" in &amp; I think it might work.

Or, change & to the word "and".

abduraooft
01-22-2010, 05:14 PM
Try
print "\t<td><div align=center><a href=\"Base_actualiza1_cadastro1.php?menu1=".urlencode($FirstName)."\" onClick='showPopup(this.href);return(false);'>".$FirstName."</a></div></td>\n";

Tulungo
01-22-2010, 05:27 PM
Excelent it works with ".urlencode($FirstName)." but your post =".urlenclode($FirstName)." one "L" more :thumbsup:

Thanks!!!!!!!

Dormilich
01-23-2010, 12:04 PM
Try &amp; (for ampersand) and see if that works.
Even though there's a "&" in &amp; I think it might work.

it doesn’t work. in XHTML it is even required to use &amp;.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum