Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem passing parameters in url

Status
Not open for further replies.

h2mhd

Programmer
Feb 20, 2008
40
CA
Hi

i have made an website that use popup, so whe you click on a picture a popup appears and show the larger pictures and some details like his name, size, and status.

My problem is when the name of the image as an ' the results gives me \' and i want to have only l' by exemple.

Heres the code i use:

popup-hd.php:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title><?php
echo "$name";
?></title>
<link rel="stylesheet" type="text/css" href="kg.css" />
</head>
<body>

<table border="0" width="100%" align="center">
<tr>
<td align='center'>
<?php
echo '<img src="'.$chemin.'" alt="" />';
?>
</td>

</tr>
<tr>
<td><div class="content">
<?php
echo "$name";
?>
</td></div>
</tr>
<tr>
<td><div class="content">
<?php
echo "$sizepict";
?>
</td></div>
</tr>
<tr>
<td><div class="contentSold">
<?php
echo "$statusimg";
?>
</td></div>
</tr>
</table>

</body>
</html>

and heres the code that calls the php

<a href="popup-hd.php?chemin=/images/amerique/oem/popup/aux_aguets_butor_amerique.jpg&sizepict=60 par 40&statusimg=Vendu&name=Aux aguets Butor d'Amérique" target="popup" onClick="wopen('popup-hd.php?chemin=/images/amerique/oem/popup/aux_aguets_butor_amerique.jpg&sizepict=60 par 40&statusimg=&name=Aux aguet Butor d\'Amérique, 'Aux aguets butor d\'amérique', 500, 650); return false;"><img style="border:1px solid black;margin:7px 0 7px 7px;width:175px;height:357px" src="images/amerique/oem/popup/aux_aguets_butor_amerique.jpg" alt="Aux aguets butor d'Amérique" title="Karine Bergeron - Aux aguets butor d'amérique" /></a>

and heres the javascript that open the popup window:

<script>
<!--
function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
// In my tests these work well on all platforms & browsers.
w += 32;
h += 96;
var win = window.open(url,
name,
'width=' + w + ', height=' + h + ', ' +
'location=no, menubar=no, ' +
'status=no, toolbar=no, scrollbars=no, resizable=no');
win.resizeTo(w, h);
win.focus();
}
// -->
</script>

heres the result of the popup:

Aux aguets Butor d\'Amérique the ' is always there and i want to remove it can you tell me how to do that?

Thanks a lot

 
Hi there,

I am quite a noob, but I think you need to look at the stripslashes function.


From your example above...

Code:
    <td><div class="content">
    <?php
    echo "stripslashes($name)";
    ?>
    </td></div>

I hope this helps.

Remember- It's nice to be important,
but it's important to be nice :)
 
the problem is not in the output but in the way that you process and store the input.
I suspect that you have magic_quotes_runtime and/or magic_quotes_gpc turned on. stripslashes will patch the output but will not address the underlying problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top