Jump to content

[SOLVED] PHP escaping...?


Patrick3002

Recommended Posts

Hi.

 

I have a name in my DB called: !#$ The %&*! (Fuck The Bullshit)

 

When i click that link on my page "<a href="http://lyricdbonline.com/view.php?song=!#$%20The%20%&*!%20(Fuck%20The%20Bullshit)">http://lyricdbonline.com/view.php?song=!#$%20The%20%&*!%20(Fuck%20The%20Bullshit)</a>"

 

It has all of those weird characters in it such as !, #, $, %, &, *...

 

And when i click it, it doesnt display any of the data that im trying to pull from the db for that name "!#$ The %&*! (Fuck The Bullshit)" because of all of those special characters.

 

Is there anyway that i could escape those so i could use my script on that name, such as....

 


<?php
  
  include_once("includes/config.php");
$song=$_GET['song'];
$song = mysql_real_escape_string($song);
$lTable="lyrics_01";


$glInfo="SELECT * FROM $lTable WHERE song = '$song'";
$lResult=mysql_query($glInfo);

$aNum=mysql_num_rows($lResult);

$aI=0;

while ($aI < $aNum) {
	$pc=mysql_result($lResult,$aI,"pc");
	$artist=mysql_result($lResult,$aI,"artist");
	$pBy=mysql_result($lResult,$aI,"pBy");
	$email=mysql_result($lResult,$aI,"email");
	$lyric=mysql_result($lResult,$aI,"lyric");
	$date=mysql_result($lResult,$aI,"date");
	$scount=mysql_result($lResult,$aI,"scount");

	$aI++;
	$scount++;
}


$cTotal = "UPDATE $lTable SET scount = '$scount' WHERE song = '$song'";
	$cResult=mysql_query($cTotal);

$song = stripslashes($song);
$artist = stripslashes($artist);

?>


 

Where "!#$ The %&*! (Fuck The Bullshit)" is $song

 

 

Any help is much appreciated!

Link to comment
https://forums.phpfreaks.com/topic/56443-solved-php-escaping/
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.