Alright I am trying to deal with a small issue. I need to have a javascript popup link echod by php. This is the code I have now. I know it doesn't work. the quotes just aren't in the right place, can someone figure it out? print '<a href="unit_note1.php?id='.$unitid." onClick=\"return popitup(\'unit_note1.php?id='.$unitid.'\')">Click here</a>'; PHP: Here is another instance I am using this but it is setup as html <a href="unit_note1.php?id=<? print $unitid; ?>" onClick="return popitup('unit_note1.php?id=<? print $unitid; ?>')">Add note</a> HTML:
print("<a href=\"unit_note1.php?id=".$unitid."\" onClick=\"return popitup('unit_note1.php?id=".$unitid."')\">Add note</a>"); PHP:
This might work. <?php $query = empty($_SERVER['QUERY_STRING']) ? '' : '?' . urldecode($_SERVER['QUERY_STRING']); echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . $query; ?> Code (markup): Will
Im sure all that returns is the current page url, all he wanted is for his html to be backslashed accordingly, so it can be parsed in php.
Perhaps this will work. <?php $unitid = 'AAA'; print("<a href=\"unit_note1.php?id=$unitid\" onClick=\"return popitup('unit_note1.php?id=$unitid')\">Add note</a>"); ?> Code (markup): The above prints this. <a href="unit_note1.php?id=AAA" onclick="return popitup('unit_note1.php?id=AAA')">Add note</a> Code (markup): Will