Ask a Question related to PHP Development, Design and Development.
-
Mark #1
'onmouseover' javascript in .php echo command, is proving troublesome?
Hi,
Can anyone please tell me what is wrong with this code ?
I have a 2d Array defined in an included PHP file as follows :-
/Site #1
$sitename[0][0]="The Site Name";
$bannerlocation[0][0]="banners/468x60_2126.gif";
$bannerdescrition[0][0]="Visit my site!";
$sitelink[0][0]=http://www.mysite.com;
In my main PHP file, I have the following line
echo "<center><a href='".$sitelink[$bantype][$bancode]."'
onmouseover='status=\"Visit .$sitename[$bantype][$bancode]. \"'; return
true' onmouseout='status=\" \"; return true'
target='".$sitename[$bantype][$bancode]."'><img
src='".$bannerlocation[$bantype][$bancode]."' border='0'
alt='".$bannerdescription[$bantype][$bancode]."'></a></center><br>";
This displays the graphic accordingly, and the link also works. HOWEVER,
when placing the mouse over the banner, instead of saying "Visit The Site
Name", it says the href link on the status bar instead, as if the
'onmouseover' javascript never existed ?
Any help much appreciated.
Thanks, Mark
Mark Guest
-
error in javascript when creating command dialog
when I create a command dialog as a dreamweaver extension, the "readonly" attribute of either textarea or input are not working. is there any method... -
Certificate is Proving Difficult - Help, Please!
I am using the Certificate template from InDesign... But, it's on 11.5 inch long paper -when I tried to size to 11 inch paper, suddenly there is a... -
Echo command option for db2
-v for echo. In the sample below, the file connect.sql contains connect to sample; C:\tmp>db2 -t -v -f connect.sql connect to sample Database... -
how to display variables within using echo command within html code
this is part of my code question? why the variable $name and $address does not display on the html page instead of real values I do get... -
Troublesome listbox
Can't seem to solve this. The object is to have all linked subforms update while cycling parentmost form. The listbox also needs to update to... -
jrf[no] #2
Re: 'onmouseover' javascript in .php echo command, is proving troublesome?
Mark wrote:
You're missing some quotes ... Did you look at the resulting source ? It> Hi,
>
> Can anyone please tell me what is wrong with this code ?
>
> I have a 2d Array defined in an included PHP file as follows :-
>
> /Site #1
> $sitename[0][0]="The Site Name";
> $bannerlocation[0][0]="banners/468x60_2126.gif";
> $bannerdescrition[0][0]="Visit my site!";
> $sitelink[0][0]=http://www.mysite.com;
>
>
> In my main PHP file, I have the following line
>
> echo "<center><a href='".$sitelink[$bantype][$bancode]."'
> onmouseover='status=\"Visit .$sitename[$bantype][$bancode]. \"'; return
> true' onmouseout='status=\" \"; return true'
> target='".$sitename[$bantype][$bancode]."'><img
> src='".$bannerlocation[$bantype][$bancode]."' border='0'
> alt='".$bannerdescription[$bantype][$bancode]."'></a></center><br>";
>
>
> This displays the graphic accordingly, and the link also works. HOWEVER,
> when placing the mouse over the banner, instead of saying "Visit The Site
> Name", it says the href link on the status bar instead, as if the
> 'onmouseover' javascript never existed ?
>
>
> Any help much appreciated.
>
>
> Thanks, Mark
>
>
would have showed you the problem
Try this:
echo '<center><a href="' . $sitelink[$bantype][$bancode]. '"
onmouseover="status=\'Visit ' . $sitename[$bantype][$bancode]. '\';
return true;" onmouseout="status=\' \'; return true;" target="'
.. $sitename[$bantype][$bancode] . '"><img src="'
.. $bannerlocation[$bantype][$bancode] . '" border="0" alt="'
.. $bannerdescription[$bantype][$bancode] . '"></a></center><br>';
jrf[no] Guest
-
Duyet The Vo #3
Re: 'onmouseover' javascript in .php echo command, is proving troublesome?
I would not break the line at "return true". Also use onmouseover=" .... "
This works:
echo "<center><a href='".$sitelink[$bantype][$bancode]."'
onmouseover=\"status='Visit ".$sitename[$bantype][$bancode]." '; return
true\"
onmouseout='status=\" \"; return true'
target='".$sitename[$bantype][$bancode]."'><img
src='".$bannerlocation[$bantype][$bancode]."' border='0'
alt='".$bannerdescription[$bantype][$bancode]."'></a></center><br>";
HTH.
"Mark" <mark_news@horsemad.co.uk> wrote in message
news:9yfed.254$qj2.253@newsfe6-win.ntli.net...> Hi,
>
> Can anyone please tell me what is wrong with this code ?
>
> I have a 2d Array defined in an included PHP file as follows :-
>
> /Site #1
> $sitename[0][0]="The Site Name";
> $bannerlocation[0][0]="banners/468x60_2126.gif";
> $bannerdescrition[0][0]="Visit my site!";
> $sitelink[0][0]=http://www.mysite.com;
>
>
> In my main PHP file, I have the following line
>
> echo "<center><a href='".$sitelink[$bantype][$bancode]."'
> onmouseover='status=\"Visit .$sitename[$bantype][$bancode]. \"'; return
> true' onmouseout='status=\" \"; return true'
> target='".$sitename[$bantype][$bancode]."'><img
> src='".$bannerlocation[$bantype][$bancode]."' border='0'
> alt='".$bannerdescription[$bantype][$bancode]."'></a></center><br>";
>
>
> This displays the graphic accordingly, and the link also works. HOWEVER,
> when placing the mouse over the banner, instead of saying "Visit The Site
> Name", it says the href link on the status bar instead, as if the
> 'onmouseover' javascript never existed ?
>
>
> Any help much appreciated.
>
>
> Thanks, Mark
>
>
Duyet The Vo Guest
-
Mark #4
Re: 'onmouseover' javascript in .php echo command, is proving troublesome?
Excellent - Thankyou both for your help.
Thanks, Mark
Mark Guest



Reply With Quote

