[KLUG Members] php and quotation marks

Lunitix lunitix at earthlink.net
Mon Sep 26 22:35:32 EDT 2005


Sorry.  I intended to include the code for the input/update page.

$update=$_GET['update'];
$catnum=$_GET['jeop_catnum'];
$category=$_GET['jeop_category'];
$ques2=$_GET['jeop_ques2'];
$ans2=$_GET['jeop_ans2'];
$ques4=$_GET['jeop_ques4'];
$ans4=$_GET['jeop_ans4'];
$ques8=$_GET['jeop_ques8'];
$ans8=$_GET['jeop_ans8'];
$ques16=$_GET['jeop_ques16'];
$ans16=$_GET['jeop_ans16'];
$ques32=$_GET['jeop_ques32'];
$ans32=$_GET['jeop_ans32'];
$ques64=$_GET['jeop_ques64'];
$ans64=$_GET['jeop_ans64'];
$ques128=$_GET['jeop_ques128'];
$ans128=$_GET['jeop_ans128'];
$ques256=$_GET['jeop_ques256'];
$ans256=$_GET['jeop_ans256'];

if ($update=='true') {
	$query="UPDATE single SET
	category='$category', ques2='$ques2', ans2='$ans2', ques4='$ques4', 
ans4='$ans4', ques8='$ques8', ans8='$ans8', ques16='$ques16', 
ans16='$ans16', ques32='$ques32', ans32='$ans32', ques64='$ques64', 
ans64='$ans64', ques128='$ques128', ans128='$ans128', 
ques256='$ques256', ans256='$ans256'
	WHERE catnum='$catnum' ";
} else {
	$query="INSERT INTO single ( catnum, category, ques2, ans2, ques4, 
ans4, ques8, ans8, ques16, ans16, ques32, ans32, ques64, ans64, ques128, 
ans128, ques256, ans256) VALUES ('$catnum', '$category', '$ques2', 
'$ans2', '$ques4', '$ans4', '$ques8', '$ans8', '$ques16', '$ans16', 
'$ques32', '$ans32', '$ques64', '$ans64', '$ques128', '$ans128', 
'$ques256', '$ans256')";
}

Lunitix wrote:
> I, not too long ago, asked a question about quotation marks (") with php 
> and mysql.  The response was to add htmlspecialchars to my code.  That 
> allows the quotation marks (") can now be used, but the flipside is that 
> single quotes (') now creates the errors that the double quotes did.
> 
> How can I get both the single and double quotes to work?
> 
> Minding of Madness
> Jon
> _______________________________________________
> Members mailing list
> Members at kalamazoolinux.org
> 
> 


More information about the Members mailing list