?
Solved

PHP concatination question

Posted on 2011-04-19
6
Medium Priority
?
270 Views
Last Modified: 2012-05-11
Hi, How can I add this line to the href link code below?

onMouseover="return hidestatus()"
<a class="dl" href="' . $dl['url'] . '/pdf/' . $num[$i] . '">

Open in new window

0
Comment
Question by:Computer Guy
6 Comments
 
LVL 15

Expert Comment

by:dirknibleck
ID: 35424223

Open in new window

<a class="dl" href="' . $dl['url'] . '/pdf/' . $num[$i] . ' onMouseover="return hidestatus()"' . '">

Open in new window

0
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 2000 total points
ID: 35424228
Why not <a class="dl" href="' . $dl['url'] . '/pdf/' . $num[$i] . '" onMouseover="return hidestatus()">?
0
 
LVL 12

Expert Comment

by:enachemc
ID: 35424230

<a class="dl" href="<?=$dl['url']?>/pdf/<?=$num[$i]?>">

Open in new window

0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
LVL 31

Expert Comment

by:Marco Gasi
ID: 35424286
Is your code part of an echo statement?
0
 
LVL 15

Expert Comment

by:dirknibleck
ID: 35424464
I have an error in my suggestion. MarqusG's is correct.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 35424647
As written this line seems to be an incorrect mixture of HTML and PHP.

<a class="dl" href="' . $dl['url'] . '/pdf/' . $num[$i] . '">

Maybe if it is in PHP, you would start with something like the code snippet, then insert the Javascript prompt code into the collection of echo statements.  I find putting one thing on each line makes for easier coding, debugging and modification.
echo '<a class="dl" ';
echo 'href="';
echo $dl['url'];
echo '/pdf/';
echo $num[$i];
echo '">';

Open in new window

0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question