Correct nesting of apostrophe's/quotation marks in html/php statement -
so im trying make possible user select file list , delete file server. know there alot of safety concerns neglecting here need basic version of work now. following on other threads here linkby u select file delete:
echo '<a href="delete.php?file=ebooks/'.$name.'" onclick="return confirm(\'are sure?\')">delete</a>';
my problem ad variable $name link breaks nesting of quotation marks, escaping them doesn't work since renders string "$name" , not variable. can please give me or me see correct way write statement? thanks
wrap $name in urlencode():
echo '<a href="delete.php?file=ebooks/'.urlencode($name).'" onclick="return confirm(\'are sure?\')">delete</a>';
Comments
Post a Comment