Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10774

Re: problem with many buttons

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <2017243.GSzyx3rZ4e@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <php@PointedEars.de>
Organization PointedEars Software (PES)
Date Mon, 16 Sep 2013 15:41:26 +0200
User-Agent KNode/4.10.5
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: problem with many buttons
Newsgroups comp.lang.php
References <9e813751-629b-4768-beee-e061431da1d4@googlegroups.com> <l16q8i$qgl$1@dont-email.me>
Supersedes <17466523.evIHLM3xrv@PointedEars.de>
MIME-Version 1.0
Lines 40
NNTP-Posting-Date 16 Sep 2013 15:41:26 CEST
NNTP-Posting-Host 272feb14.newsspool4.arcor-online.net
X-Trace DXC=[Om4M>GO?`TPU8j_I0DN6_4IUK<Cl32<Q4Fo<]lROoRQ8kF<OcfhCO[:;[^=Pn_eYQDZm8W4\YJN\b@mF9jNikdUDZIgZChmYc[j5YlP@`ig2R
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.php:10774

Show key headers only | View raw


Fiver wrote:

> 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>

I am afraid that this code is not going to work until someone with a minimum 
clue will be rewriting it.  For example,

| echo "<li><button id=$bgname onclick = return(blogId($this))>".
| $row['blogs_name']."</button></li>";

is not going to work already because “$this” will be expanded to "" while 
generating the notice “Undefined variable: this”.  It must be “this” 
instead, and the “onclick“ attribute value must be quoted; but to know that 
you have to have at least a basic understanding of HTML, and you have to 
know the difference between server-side and client-side code, and between 
PHP (used here server-side) and ECMAScript/JavaScript (used here client-
side).


PointedEars
-- 
When all you know is jQuery, every problem looks $(olvable).

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

problem with many buttons Avnesh Shakya <avnesh.nitk@gmail.com> - 2013-09-15 23:25 -0700
  Re: problem with many buttons Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-09-16 12:57 +0200
  Re: problem with many buttons Fiver <numeralfive@gmail.com> - 2013-09-16 13:32 +0200
    Re: problem with many buttons Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-09-16 15:41 +0200

csiph-web