How to add javascript into PHP
How would I make this work?
eg:
Lets say I have this javascript:
and I want to add it into this PHP:Code:<a href="search.htm" onClick="return overlay(this, 'subcontent2', 'rightbottom')">login</a>
PHP Code:
<?php
// Are they a guest?
if ($context['user']['is_guest'])
{
// Show a login box...
// Uncomment below to show login box
// ssi_login();
// ... and a little notice about registering
echo '
Welcome, <b>Guest</b>, Please **THE JAVASCRIPT HERE** or';
echo '
<a href="', $scripturl, '?action=register">register</a>';
}
// Otherwise, a user here :)
else
{
// Show them a nice welcome notice
ssi_welcome();
echo ' ';
// And a logout link
ssi_logout("#");
}
?>



Reply With Quote

Bookmarks