I am trying to edit this code to make it a link which opens ins a new tab, but wherever I insert the "target='blank'" part in the code I get a parse error, can anyone one help me out please. Thanks.
$websiteurl = "" . $_POST['websiteurl'] . "";
need to add:
target='blank'
$websiteurl = '<a target="_blank" href="' .
$_POST['websiteurl'] . '">' . $_POST['websiteurl'] . '</a>';
You missed _.
put target="_blank"
Mine is like this:
$output .= "<p class='fb-page-name'><a href='". $app['link'] ."' title='". $app['name'] ."'>". $app['name'] ."</a></p>\n";
I had to use target='_blank' instead of target="_blank".
I'm just saying because maybe someone is struggling with it as I was.
$websiteurl = '' . $_POST['websiteurl'] . '';
Related
I'm displaying a woocommerce notice with a popup shortcode inside. When you try to click it, it works but redirects the URL to ' /void(0 '. How to amend this code to prevent this from happening. Thanks
$message = __( 'Please Sign Up or Login', 'my-plugin ' ) . do_shortcode('[arm_form popup="true"]');
wc_add_notice( $message );
I'm using a plugin called AR Member , I had to change the following:
wp-content/plugins/armember/core/classes/class.arm_member_forms.php
Line: 1699
Before:
$popup_content .= '<a href="javascript:void(0)" id="' . $popupLinkID . '"
class="' . $popupLinkClass . ' arm_form_popup_ahref" ' . $popupLinkAttr . '>'
. $link_title . '</a>';
After:
$popup_content .= '<a href="#" id="' . $popupLinkID . '" class="' .
$popupLinkClass . ' arm_form_popup_ahref" ' . $popupLinkAttr . '>' .
$link_title . '</a>';
The downside is that when the plugin updates I will have to update it again, maybe someone could advise if this can be pulled into theme functions in some way?
Thanks to #Basharmal for a pointer in the right direction :-)
Please change the plugin code .
Go to
popup-anything-on-click/includes/shortcode/popupaoc-popup-shortcode.php
find the code line no 79 to 84 prnt.sc/q882pq
just replace the code
“javascript:void(0);”
to
“#”
this way
prnt.sc/q883t9 Note:-In
the future if plugin will update your code will lose
I'm trying to get this so when I click the image, the image then shows in a new tab so it's able to be saved
I've tried adding the a href tags inside and around.
Code:
echo "<img src=" . random_image('css/avatars') . " />";
This is what you want:
echo '<img src="' . random_image('css/avatars') . '" />';
You should try
echo "<a target='_blank' href='".random_image('css/avatars')."'>"."<img src=" . random_image('css/avatars') . " /></a>";
I think this can help you
The problem is that you are not properly concatenating your string with what you get from random_image function.
You can try following code, here I am assuming that your random_image function returns complete path to your image
function random_image($path)
{
// returning dummmy image
return "https://images.unsplash.com/photo-1535498730771-e735b998cd64?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=623ed05afcc5a3fa1e444ffca95854dc&w=1000&q=80";
}
echo "<a href='".random_image('css/avatars')."' target='_blank'> <img src='".random_image('css/avatars')."' /></a>";
can anyone tell my why this:
echo "<a href='productdetail.php?product=" . $rij['productnaam'] . "'><img src='../images/producten/monster_energy_green.png' alt='' /></a>";
does give a clickable image link, and this:
echo "<a href='productdetail.php?product=" . $rij['productnaam'] . "'><img src='" . $rij['afbeelding_klein'] . "' alt'productafbeelding' /></a>";
doesnt? (not clickable).
thanks in advance!!
php rookie..
In the first one you have a real scr it's directing to with a file extension. the second does not. If the second is supposed to be picking up a variable we would need more information
echo "<a href='productdetail.php?product=" . $rij['productnaam'] . "'><img src='" . $rij['afbeelding_klein'] . "' alt='productafbeelding' /></a>";
just add a "=" between alt and 'productafbeelding'
Try this one:
echo '<img src="' . $rij['afbeelding_klein'] . '" alt="productafbeelding" />';
I am using the following snippet. How do I add q=$k in the <a href url>?
<?php
echo '<a id=d href="'.$_SERVER['PHP_SELF'].'?pg='.($s+10).'">Next</a>';
?>
<?php
echo '<a id=d href="'.$_SERVER['PHP_SELF'].'?pg='.($s+10).'&q='.$k.'">Next</a>';
?>
Something like that?
echo '<a id=d href="' . $_SERVER['PHP_SELF'] . '?pg=' . ($s+10) . '&q=' . $k . '">Next</a>';
You can do this:
echo "<a id='d' href='" . html_entities("$_SERVER[PHP_SELF]?pg="
. urlencode($s + 10) . "&q=" . urlencode($k)) . "'>Next</a>";
I added suitable escaping for the URL parameter and HTML output: URL encoding for the URL GET parameters, and HTML entity replacement for the entire URL string.
my question is how I can echo this the right way
because the variable in the onclick function gives out a undefined error
$openchat="<a href='javascript:void(0)' onClick='return chatWith(" . $livenaam .")'>" . $livenaam . "</a><br>";
echo $openchat;
I want to use it in a loop to get a list off users online for the chat
Thanks, Richard
Looks like you are missing some quotes:
$openchat="<a href='javascript:void(0)' onClick='return chatWith(\"" . $livenaam ."\")'>" . $livenaam . "</a><br>";
or for increased security:
$openchat="<a href='javascript:void(0)' onClick='return chatWith(\"" . htmlspecialchars($livenaam,ENT_QUOTES) ."\")'>" . htmlspecialchars($livenaam,ENT_QUOTES) . "</a><br>";
Try this:
'' . htmlspecialchars($livenaam) . '<br>'
If json_encode is not available, try this:
'' . htmlspecialchars($livenaam) . '<br>'