im working on php page where for call contend in same page i’ve added
<?php if (isset($cpID)) { echo ' '; }
i’ve added in the two ” some code that work nice, but have small troubles with this code:
onClick="location.href='waiting.php?picID='.$cpID.''"
it’s give me syntax error and i not know how place it in the PHP if set, please can help me? Thanks Stew
COMPLETE CODE:
<?php
if (isset($cpID)) {
echo '</p><button class="btn btn-large btn-block btn-success" onClick="location.href='waiting.php?picID='.$cpID.''" type="button">Click here to upload this Cover to your Facebook Profile</button></p>';
}
?>
Problem:
The problem is that your single quote for the echo is being closed by the one next to
location.href='You need to escape your single quotes.Solution:
Please notice, I have escaped the single quotes with
\'