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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.