Show url inside a tab - php

This is probably a very easy question however I have been banging my head for the last week on how to solve this problem
I am using query tabs
In say tab 6 I have got a link to a php file. What I want to do is when tab 6 is opened display the url e.g. my folder/file.php?p=x&p=y&p=z .inside the tab.
I have tried the following:
<img scr="folder/file.php?p=x&p=y&p=z">
also
However noting will display
Is there anybody who can help?
thanks for looking

<img scr="folder/file.php?p=x&p=y&p=z">
Should be
<img src="folder/file.php?p=x&p=y&p=z" />
notice the typo in scr/src ^

Related

Display google favicon and entity in img source in Laravel

looking for solve my issue.
i do a edit on a laravel site, but i cant call back the site url (entity.toUrl) for add to the "img src" with a google favicon.
i need to change the "imageIconUrl" with the "toUrl"
actual situation:
<a target="_blank" class="entity-url" :href="entity.toUrl">
<img :src="entity.imageIconUrl" :alt="entity.title">
<span>#{{entity.toUrl}}</span>
</a>
i try to edit from:
<img :src="entity.imageIconUrl" :alt="entity.title">
to (removed : before src and change to entity.toUrl):
<img src="http://www.google.com/s2/favicons?domain=#{{entity.toUrl}}" :alt="entity.title">
or:
<img src="http://www.google.com/s2/favicons?domain={{$toUrl}}"
but now if i check on site the source of the favicon image i get back this url:
https://www.google.com/s2/favicons?domain={{entity.toUrl}}
and not
https://www.google.com/s2/favicons?domain=example.com
when i call it in the <span>#{{entity.toUrl}}</span> work but not in the img src
any suggestion for help me?
many thanks
Not sure I completely understand your scenario, but assuming entity
is a variable being passed on to your view from the controller, you may try the following:
<img src="http://www.google.com/s2/favicons?domain={{$entity->toUrl}}" :alt="entity.title">
note there is no "#" before the {{...}} and the variable should be prefixed with $.
If you want to use title from entity in the image alt, it should work in the same way:
<img src="http://www.google.com/s2/favicons?domain={{$entity->toUrl}}" alt="{{$entity->title}}">
Note that I am not an expert - just another newbie looking for solutions here. :)
good luck!

Getting large thumbnail photos from Instagram is no longer working with "replace"

For long time I use this "replace function" to get the thumbnails by Instagram API, it worked well but now they changed somethings and I no longer to use bigger thumbnails by this way.
src="<?= str_replace('s150x150/', 's320x320/', $post->images->thumbnail->url) ?>">
By default thumbnail, it works well.
https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s150x150/e35/c0.135.1080.1080/26335890_2247807142112483_5882778660510892032_n.jpg
But replaced thumbnail size to bigger, it appears a msg: Invalid URL signature.
https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s320x320/e35/c0.135.1080.1080/26335890_2247807142112483_5882778660510892032_n.jpg
Anyone can help to get bigger thumbnail of Instagram. They changed API and I feel so tired with Facebook, they have made many changes since sync with FB and everytime like this, the developers have to update with no instructions.
You can try with this trick
src="<?= str_replace('s150x150/', 's320x320/', str_replace('vp/', '', $post->images->thumbnail->url)) ?>">
or
src="<?= str_replace('s150x150/', 's640x640/', str_replace('vp/', '', $post->images->thumbnail->url)) ?>">
You have to replace (delete) also "vp/" on url, and works again.
It's a really bad solution, but it's the only that i've found.
Copy the link of the profile pic after the "/s150x150/xxxxxxxx......jpg" to the end of this:
"https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/"
like: https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/xxxxxxxx......jpg
Works right now.
A solution would be very nice!
I have also done it like you the last few month.
I think one of the solutions is to use non-squared fotos from instagram (you get with "standard_resolution") and set it as a background-image and do the "square" via css and display cover… 
This is my personal solution at the moment… 
i opened instagram on google chrome selected the desired post, right-clicked to "save as". after opening the saved html doc. in chrome i right-clicked again to veiw page source. i scrolled down to line 217 of the page source and one of the links there gave me the picture i wanted. not sure that it is the same thing as before but it let me download the picture of the post in a .jpg format. hope this helps

Multiple window.open not working in IE

I've got an ahref that when clicked, changes the content of 3 iFrames. Here's the code:
<a href='weekone.php' target='weekone' onclick='window.open("weektwo.php","weektwo"); window.open("weekthree.php","weekthree")'>Link</a>
Now this works perfectly in Firefox, Safari etc but doesn't work in IE. Can anyone shed some light on this problem for me please? I can't use a Javascript because I'm working within a PHP framework and the iFrame links are called from the database.
UPDATE
It appears the issue lies with spaces in the URLs called from window.open! As I'm calling info from a database (ie - "weektwo.php?Name=Bob and Dave") how can I get around this??
What version of IE?
Tested on IE 8 and this worked perfectly.
<a href='test.htm' target='weekone' onclick='window.open("test.htm","weektwo"); window.open("test.htm","weekthree")'>Link</a>
<iframe name='weekone' id='weekone' width=100 height=100></iframe>
<iframe name='weektwo' id='weektwo' width=100 height=100></iframe>
<iframe name='weekthree' id='weekthree' width=100 height=100></iframe>
If you're trying to open links in an <iframe>, it's probably easier to do
document.querySelector('iframe[name="weekone"]').src='test.htm';
document.querySelector('iframe[name="weektwo"]').src='test.htm';
document.querySelector('iframe[name="weekthree"]').src='test.htm';
(I've used document.querySelector because it's the easiest, but of course you can use document.getElementById or whatever way you want to get a reference to the <iframe>.)
On the back of the comments, try adding "return true;" to the end of the onclick (untested)...
<a href='weekone.php' target='weekone' onclick='window.open("weektwo.php","weektwo"); window.open("weekthree.php","weekthree"); return true;'>Link</a>
UPDATE
In light of the updated question, try "HTML Encoding" the query strings using the PHP function "htmlentities".
I'm basing the following on your original (pre-edited) code. So in this case I apologise for asking you to edit it, but I did ask you to show exactly what was being sent to the browser...
<a href='weekone.php?Name=<?=htmlentities($i[Name])?>' target='<?=$i[Name]?> weekone' onclick='window.open("weektwo.php?Name=<?=htmlentities($i[Name])?>","<?=$i[Name]?> weektwo"); window.open("weekthree.php?Name=<?=htmlentities($i[Name])?>","<?=$i[Name]?> weekthree")'>Link</a>
UPDATE 2 (due to me being stupid)
It shouldn't be "HTML Encoding" it should be "URL Encoding" using "urlencode"...
<a href='weekone.php?Name=<?=urlencode($i[Name])?>' target='<?=$i[Name]?> weekone' onclick='window.open("weektwo.php?Name=<?=urlencode($i[Name])?>","<?=$i[Name]?> weektwo"); window.open("weekthree.php?Name=<?=urlencode($i[Name])?>","<?=$i[Name]?> weekthree")'>Link</a>

target="_self" mysteriously changed into "_blank" on its own

I'm working with php to make some web pages and I'm having a bit of struggle with a link I'm trying to make.
Basically I have my <a> set with target="_self" on it so that it stays on the same page. (Note the page is a new window and that I also tried using "_top" and "_parent")
<img src="<?php echo $donnees[0]['id2_pathImgMini'] ?>" width="75" height="75" />
This is said link in its php form.
<img src="../images/propriete/DosAssorti/mini/L482_mini.jpg" width="75" height="75" />
This is the result arcoding to the browser when showing the source code.(Across IE,Firefox,Chrome)
<a target="_blank" href="http://ordi-003/inclusion/fiche.dos.assorti.info.php?id=14&lan=fr">
This is the same line according to Firebug AND the Chrome developping tools.
When clicking the linking the expected result is opening the link on the same page, however it opens it in a new window. Changing inside firebug "_blank" to "_self" and clicking the link afterwards gives the good results and opens the link on the same page.
Am I doing something wrong? Am I incorrectly using the <a> here?
Should I look for another way to make my link? I'm pretty open to anything really I tried different things and looked alot on google but couldn't find people with the same problem. Firefox cache is deactivated so that should not be the issue. Tried it on another computer too and it gives the same results.
If I gave too short information just tell me what I should also include as I am new to stack overflow.
Edit:I forgot to say that if I remove the target parameter and just put none, the "source code page" doesn't show anything like it should but in firefug and chrome dev tools it shows a target="_blank" still. Also just a note, there is only 1 copy of this file and it is on the localhost of the machine running the local site. I'm directly editing that file.
Edit2: http://pastebin.com/yrAMQEL9 be aware the indentation is awful on pastebin for some reason.
You're running different code than the code you're editing. Make sure your changes are making it to the server you're visiting in the browser and that you're editing the right file.
I finally found what was causing the replacement of my _self.
In the footer there was a script which was referenced and trough further research I found this bit of code
jQuery('a[href^=http]:not(.in)').attr({
'target' : '_blank'
});
It caused the replacement of the _self to a _blank.
Now that I know where the problem came from I just have to check with the original coder of that function why he needed it and if it is still needed.
Thanks all for your help.

How to make a onmouseover work in mysql catalog

I'm having difficulty creating a button on my catalog page, the catalog page returns either 8 15 or 20 products from a mysql database so i use a loop to pull each product out of the database, and i need a addtocart button which uses javascript to create an onmouseover effect the code is as follows
echo "<a href=\"catalog.php?buyproduct=$productNumber\" onmouseover=\"document.crt.src='images/addcrt_btn_dn.png'\"
onmouseout=\"document.crt.src='images/addcrt_btn.png'\">
<img src=\"images/addcrt_btn.png\" name=\"crt\" alt=\"Add to cart\" width=\"81\" height=\"24\"> </a>";
it displays the image properly but nothing happens when the mouse is put over the image. I'm guessing that this could be caused because since either 8 15 or 20 of these images are being created, the "name=crt" is throwing the whole thing off, if so how could i fix this?
Any advice would be helpful thank you!
Instead of using the name attribute on the <img>, I would start by recommending you use the id attribute, as follows:
<img id="crt" />
Then you can change the src as follows:
document.getElementById('crt').src = 'images/addcrt_btn_dn.png';
Make sure you properly escape all those quotes properly, or work on generating the content another way (here's an example sticking with the name attribute):
...
?>
<a href="catalog.php?buyproduct=<?php=$productNumber?>" onmouseover="document[crt].src='images/addcrt_btn_dn.png'" onmouseout="document[crt].src='images/addcrt_btn.png'">
<img src="images/addcrt_btn.png" name="crt" alt="Add to cart" width="81" height="24">
</a>
<?php
...

Categories