BadGoat Posted June 5, 2007 Share Posted June 5, 2007 Hello! I am trying to get a hyperlink with embedded php to work also with a java function. The goal is to get all the data associated with the 'diw_id' record. The link, in it's current, non-working state: echo"<a href=\"/edits/edit_status.php?diw_id=".$row[diw_id]."\" onClick=\"openPic('/edits/edit_status.php?'.$row[diw_id].' size=small','pop','600','200'); return false\">[edit]</a></td> openPic is a Java function: function openPic (url,name,wide,high) { var window_top = (screen.height-high)/2; var window_left = (screen.width-wide)/2; newWindow = window.open('' + url + '',''+ name +'','height=' + high +',width=' + wide + ',top=' + window_top + ',left=' + window_left + ', scrollbars'); } function closeWindow() { if (window.newWindow && window.newWindow.open && !window.newWindow.closed) window.newWindow.close(); I'm not that familiar with Java, would I be better served leaving the URL out of the function, or is that a requirement? Quote Link to comment https://forums.phpfreaks.com/topic/54326-solved-help-getting-this-hyperlink-to-function-in-php-has-java/ Share on other sites More sharing options...
BadGoat Posted June 5, 2007 Author Share Posted June 5, 2007 OK, going through my own code, I found I constructed the Java portion incorrectly. Now, echo"<a href=\"/edits/edit_status.php?diw_id=".$row[diw_id]."\" onClick=\"openPic('/edits/edit_status.php?diw_id='".$row[diw_id]."' size=small','pop','600','200'); return false\">[edit]</a></td> "; echo' The above gives me the correct data but the pop-up window functionality is not working. But if I do echo"<a href=\"/edits/edit_status.php?diw_id=".$row[diw_id]."\" onClick=\"openPic('/edits/edit_status.php?diw_id=".$row[diw_id]." size=small','pop','600','200'); return false\">[edit]</a></td> "; echo' instead, the pop-up functionality works, but the SQL data is not pulled. Quote Link to comment https://forums.phpfreaks.com/topic/54326-solved-help-getting-this-hyperlink-to-function-in-php-has-java/#findComment-268719 Share on other sites More sharing options...
trq Posted June 5, 2007 Share Posted June 5, 2007 I don't understand why your tacking size=small onto the end of the url. Also.. you don't need half of it. <?php echo "<a href=\"#\" onClick=\"openPic('/edits/edit_status.php?diw_id={$row['diw_id']}','pop','600','200'); return false\">[edit]</a></td>"; ?> As for your database part... can we see some relevant code. PS; Its Javascript not Java, there is a huge difference between the two languages. Quote Link to comment https://forums.phpfreaks.com/topic/54326-solved-help-getting-this-hyperlink-to-function-in-php-has-java/#findComment-268815 Share on other sites More sharing options...
BadGoat Posted June 6, 2007 Author Share Posted June 6, 2007 thorpe, diw_id={$row['diw_id']}' made all the difference in the world. With that, now the pop-up pops correctly with the data from my db. Thank you kindly! Quote Link to comment https://forums.phpfreaks.com/topic/54326-solved-help-getting-this-hyperlink-to-function-in-php-has-java/#findComment-269112 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.