FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem with many buttons
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: problem with many buttons [message #182810 is a reply to message #182805] Mon, 16 September 2013 11:32 Go to previous messageGo to previous message
Fiver is currently offline  Fiver
Messages: 35
Registered: July 2013
Karma:
Member
On 2013-09-16 08:25, Avnesh Shakya wrote:
> <?php
> echo "<script type='text/javascript'>function blogId($bgid) {
> top.location.href = './blogComment.php?id=$bgid'; };</script>";
> ?>
>
> it is going on that page but not contaid this value...

echo "... $bgid ..." will try to interpolate the PHP variable "$bgid"
into the string. Depending on your settings and whether $bgid actually
exists, this will result in an error or something you didn't want.
JavaScript variables and function arguments are not usually prefixed
with a "$" sign. Try this instead (without the <?php ... ?> around it):

<script type="text/javascript">
function blogId(bgid) {
top.location.href = './blogComment.php?id=' + bgid;
}
</script>


regards,
5er
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Confirm PG-related segfault in current PHP version
Next Topic: syntax error or notepad++ error?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 08:51:09 GMT 2024

Total time taken to generate the page: 0.04019 seconds