This question already has answers here:
How do I get a book graphic and description from the Amazon Book API?
(3 answers)
Closed 7 years ago.
I want to get the cover of a book form its ASIN through Amazon API. I use the ItemLookup function, but I only get the author, manufacturer and the title.
ie :
<ItemAttributes>
<Author>Anna Gavalda</Author>
<Manufacturer>J'Ai Lu</Manufacturer>
<ProductGroup>Book</ProductGroup>
<Title>Ensemble, C'Est Tout (French Edition)</Title>
</ItemAttributes>
You can try this:
$track=$_GET['title'];
// Call To Amazon Predefined Class
$client = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'com', AWS_ASSOCIATE_TAG);
$response = $client->category('Books')->responseGroup('Images,Reviews,ItemAttributes,OfferSummary')->search($track);
// To Get Image
<img src="<?php echo $response->Items->Item[0]->LargeImage->URL ?>" width="233" height="300">
Related
This question already has answers here:
How can I display an image from the local machine on a webpage
(5 answers)
Closed 3 years ago.
How i display image from drive d or system drive.
This below code not display it please help.
<img src="file:///D:/User/tw.png" />
<img src="../../../D:/User/tw.png">
The code above will work if your current folder are like
=> C:
=> myStuff
=> projectName
=> yourCodeBelongHere
=> D:
=> User
=> tw.png
This question already has answers here:
dynamically add <p> tag in asp.net for comment system
(3 answers)
Closed 5 years ago.
Is it possible to dynamically generate <p> in ASP.NET code behind (VB)? I've been trying to find an example where <p> has been generated using HtmlGenericControl like the usual Dim div As New HtmlGenericControl("DIV")?
Thanks in advance!
You do it like this:
Dim p As HtmlGenericControl = New HtmlGenericControl("p")
p.InnerText = "The content goes here"
PlaceHolder1.Controls.Add(p)
This question already has answers here:
Get client IP address via third party web service
(7 answers)
Closed 8 years ago.
I have a textbox in a page call enquiry.
i want when my page loads my ip address will come automatically in that texbox... please help me..i need your suggestions as soon as possible .
What language are you using (server-side)?
If you want to do this in PHP, here's how:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>
<form>
<!-- other form elements here -->
<input type="text" name="ip" value="<?php if isset($ip) { echo $ip; } ?>" />
</form>
The first part gets the users IP address. The second part prints its value in the text field.
You want your users to see their ip address in a text box?
Assuming you have to do it on the client-side, you need to use javacript. Like this (taken from How to get client's IP address using javascript only?):
<script type="application/javascript">
function getip(json){
alert(json.ip); // alerts the ip address
// instead of the alert, assign the value to your text box
}
</script>
<script type="application/javascript" src="http://jsonip.appspot.com/?callback=getip"></script>
This question already has answers here:
Selecting attribute values with html Agility Pack
(7 answers)
Closed 8 years ago.
I want to get the href-link from this:
<a class="abc" href="/subsite/2014/05/19/site.html"> <p>test1</p><p>test2</p> </a>
I'm trying this:
var nodes = doc.DocumentNode.SelectNodes("//a[#class='abc']/#href");
...InnerHtml becomes <p>test1</p><p>test2</p>, not the link in the href...
As explained by HtmlAgilityPack creator, #SimonMourier, here, you can't use SelectNodes() directly to get attributes (as the method name and the return type implies, it meant to select nodes).
You need to do it with different approach. Try to select the node instead of the attribute, then you can use LINQ extension method to extract attribute of each selected nodes, for example :
var attrs = doc.DocumentNode
.SelectNodes("//a[#class='abc' and #href]")
.Select(o => o.Attributes["href"]);
This will work too, as described in the link from #Tomalak.
//Load navigator for current document
HtmlNodeNavigator navigator = (HtmlNodeNavigator)doc.CreateNavigator();
//Get value from given xpath
string xpath = "//a[#class='abc']/#href";
var val = navigator.Select(xpath);
This question already has answers here:
Getting Past Facebooks Iframe Block
(2 answers)
Closed 9 years ago.
it has been a while since my last time working with iframes, now i need to load some external sites inside iframes but nothing is happening. This are the iframe tags, the wierd thing is that nothing is being shown inside this iframes. Is there something that im missing?
for ($j = 1; $j < 10; $j++) {
$urls[] = 'http://www.facebook.com/profile.php?id='.$friends["data"][$j]["id"];
}
echo '<div class="container"><div class="row-fluid">';
foreach($urls as $url){
echo '<iframe id="face" name="face" src="'. $url .'" style="width: 100%; height: 200px;"></iframe><br>';
}
echo '</div></div>';
}
Each $url is a friend's facebook profile and they are being loaded perfectly fine but nothing is being shown inside my iframes. Any ideas? i also tried with google.com... same thing, nothing is being shown.
Likely because Facebook has explicitly disallowed iframing their pages using the X-FRAME-OPTIONS header. This is primarily a security measure, supported by newer browsers.
Look in your browser's console for a message like this:
Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.