I have 2 links.
For example - When a person clicks on the button "click here" - it should show www.google.com on the link bar, but it should redirect to "www.yahoo.com" and the person should not be able to see this "www.yahoo.com".
Yahoo and google are just used as an example.
How can I do that?
This was so ridiculously easy I guess this cannot be a hackers big secret.
Click HERE to be lured into my fake banking site
Although it does require javascript to be active on the browser
I would "recommend" using a full page iframe like this:
Upload a file to your server that contains this (in your example your server would be Yahoo!)
<!DOCTYPE html>
<html>
<head>
<style>
body, html, iframe {margin: 0; padding: 0; height: 100%; width: 100%; border: none}
</style>
</head>
<body>
<iframe src="https://google.com">
</body>
</html>
This should work alright for you and give the effect that the link is actually located on your own domain. Causing the APK download to look like it's on your machine.
The source domain can break free from the iFrame and therefore break your illusion. Many sites will do that, but it will still work properly for most of your needs.
Related
EDIT! -- The problem was to do with the browser Cache and the solution is to do a hard refresh in Chrome (CTRL + F5)
My site seems to break when switching over to from .html to .php and is not acting as expected when adding simple div elements with classes and using spanned styles or h tags.
Essentially I'm trying to add 2 simple elements to my page.
• A heading consisting of boldened and centered text.
• A div that will act as a vertical timeline.
Once I have added these elements using a h1 tag with custom styles and a simple div assigned to a class, it works as expected..
Until I add more text underneath my heading, at which point it breaks; my custom h1 tag style applied to my heading is no longer active and my timeline div disappears from view!
Even stranger.. when I delete the text the problem is still there. Even after I delete the timeline div the problem still persists.
Its only after I actually go into the css and delete the .timeline class does the span actually come back into effect, which to me makes no sense at all!
The problem is not present before switching over to php so this is how I switched from working in html to php code:
Open xampp Control Panel and ran 'Apache' and 'MySQL' and open my website project in Adobe Brackets.
Change the file extension of my index file from .html to .php .
Change the 'Live Preview Base URL to point to my project's directory in xampp's htdocs folder.
At this point the live preview works okay (apart from having to save to see updates)
Insert my heading into my document inside h1 tag and apply styles to h1 tag in css document
Create a div with a class to act as my timeline bar
At this stage, it will break if I add a line of text to the document ("is this working!?")
<div class="row" style="margin-top: 46px;">
<h1> BIOGRAPHY </h1>
Is this working!?
<div class="timeline"></div>
</div>
h1 {
font-weight: 650;
text-align: center;
}
.timeline {
width: 10px;
height: 2000px;
background: #454545;
position: relative;
margin: auto;
}
Sorry for the very long question and I hope it makes sense. I'm probably making a really silly mistake but I'm struggling to see what it is.
Thanks!
Just a quick update and a solution that I have found. I ended up switching to another local server and eventually ran into the same issue.
So the issue was actually down to the browser Cache..
The simple solution was to do a hard refresh on Chrome (CTRL + F5). This forced Chrome to read my up to date CSS file from the server.
I hope this helps someone with the same issue. And thanks for everyone's help in pointing me to all of the possible issues.
I am glad I will be able to continue to use Bracket's useful live preview feature! :)
Nothing breaks.
After replicating your code on my xampp and testing it as both .html and .php
They both have the same result.
Here is my code
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
h1 {
font-weight: 650;
text-align: center;
}
.timeline {
width: 10px;
height: 2000px;
background: #454545;
position: relative;
margin: auto;
}
</style>
</head>
<body>
<div class="row" style="margin-top: 46px;">
<h1> BIOGRAPHY </h1>
Is this working!?
<div class="timeline"></div>
</div>
</body>
</html>
if you still have an issue, I would suggest you
Restart your Xampp Server
Tryout another browser
+++ GOODLUCK +++
I'll try to explain the issue the best I can: I have two css uploads methods. The first one is with link rel and is working fine.
The second one (for performance issues), goes inside the css file and print directly the css into the page.
<!-- <link rel="stylesheet" href="<?php echo URL_SITE; ?>style/index.css" /> -->
<style>
<?php
$urlstyle = URL_SITE.'style/index.css?m='.(int) IS_ON_MOBILE;
$style = file_get_contents($urlstyle);
echo $style;
?>
</style>
There is absolutely no doubt about what is loaded. Those two methods returns the same css.
As an example we can use this part of the css
.wrapper-accueil .scroll:before {
content: "";
display: block;
width: 30px;
height: 30px;
background: url("../assets/img/picto/arrow-down.svg") no-repeat center center;
background-size: contain;
}
As you can see, there is an url inside.
When trying to load the css with the first method, the path is fine. Everything works fine.
But here comes the issues, when I try my second method writting this css inside the file where it's called. The url path of the css is wrong. (I shouldn't have the first ../ to make it works.
But here is the thing. Even if this code shouldn't be working with the second method. The file is loaded properly with no problem. And I can't understand why it's working. (And the cache is cleared ne doubt about that neither).
More stranger things, when I upload the website on server and i'm no longer in localhost, then there is indeed an issue and the file isn't found as it should be.
So working in localhost while it shouldn't. Not working in server while it should indeed not be working.
But I have something more stranger again, I got an other website. Same framework (that means same folder/file structure), same css file, same way of including the file. And with this one using the second method, the file is found in localhost and in server too...while it shouldn't be working with none of them.
I hope you have any idea cause I'm lost at this point. Thanks.
.wrapper-accueil .scroll:before {
content: "";
display: block;
width: 30px;
height: 30px;
background: url("../../assets/img/picto/arrow-down.svg") no-repeat center center;
background-size: contain;
}
May be you have a folder containing picto has on another folder
I'm not sure I get 100% what your problem is, but it seems that you load your css with relative paths from two different starting points:
Loaded with link:
www.example.com/path/to/your/application/style/index.css
=> this loads the asset from:
www.example.com/path/to/your/application/assets/img/picto/arrow-down.svg
Included in site:
www.example.com/path/to/your/application/site.php
=> this loads the asset from:
www.example.com/path/to/your/assets/img/picto/arrow-down.svg
^^^
note the missing path due to "../" in your svg path
Maybe this is the answer to your problem, feel free to clarify if I didn't get you correctly! Please also check the developer console, especially the "Network" tab in Chrome and see what exactly is requested and double check the paths there.
I know: opinion-based stuff shouldn't be asked etc., but this isn't about opinion, but for now simply about what still exists or rather what will still work today.
My concern: I am looking for a solution to generate one-page pdf files from PHP/HTML pages that get their content from a database and are rather heavily styled with CSS (also including tabular data and images). A function that lets you open or download the PDF when clicking on a link. The PDF should just basically look the same as the corresponding webpage at size A4 (I'll style it that way). As if you choose "preview/save as PDF" in MacOS' printing dialog, but without the user needing any particular software, working on any OS and browser.
I searched SO and the web, and I found a lot of old posts and pages (3 years and much older), like Convert HTML + CSS to PDF with PHP? , Generate PDF report from php and Generate PDF from HTML PHP I can't see in these posts if any of this is still up-to-date / working.
So I'd have to download all that stuff and build it into my pages, maybe only find out that it doesn't work anymore or isn't really applicable for my situation.
Could people who have experience with that kind of stuff please point me to places where I can find scripts/libraries which are able to do this and work with PHP 5.6 and 7? It doesn't have to support CSS3, I can restrict these pages to CSS2, and although I am using webfonts on that website, I can get along without them for the PDFs. Possibly for free, but also a not-too-expensive commercial solution would be okay. I'd be very grateful for any help.
You can use the mpdf library. It's very easy to learn. Here is the sample code.
It works perfectly.
You can get value from another page, using post method also. Your choice.
<?php $student_id = $_GET['student_id']; ?>
<?php
include("mpdf/mpdf.php");
$html .= "
<html>
<head>
<style>
body {font-family: sans-serif;
font-size: 10pt;
background-image: url(\"images/ok.jpg\");
background-repeat: no-repeat;
padding-top:10pt;
margin-top: 100px;
padding-top: 50px;
}
td { vertical-align: top;
border-left: 0.6mm solid #000000;
border-right: 0.6mm solid #000000;
align: center;
}
p.student_id{
padding-left : 140px;
padding-top : -27px;
}
</style>
</head>
<body>
<!--mpdf
<p class=\"student_id\">$student_id</p>
<sethtmlpageheader name='myheader' value='on' show-this-page='1' />
<sethtmlpagefooter name='myfooter' value='on' />
mpdf-->
</body>
</html>
";
$mpdf=new mPDF();
$mpdf->WriteHTML($html);
$mpdf->SetDisplayMode('fullpage');
$mpdf->Output();
?>
I'm trying to display an image within an iFrame on my page. The problem I face is that in Firefox, the image seems to be zoomed out automatically. I need to click on it to get the actual size. I know there is a manual fix for this by doing the following:
Enter about:config in Firefox address bar.
Look for browser.enable_automatic_image_resizing
Change the value to false
I was wondering though if there was something I could write on my script that would automatically take care of it?
You can use a div to get the same result as an iframe but without the resizing:
<html>
<head>
<title>foo</title>
</head>
<body>
<div style='overflow: scroll; width: 300px; height: 300px;'><img src="image.png" /></div>
</body>
</html>
If you set the image as a background image it should stop FF from scaling it.
Im integrating a simple chatbox application into my site, which is simply added by iframeing chat.php
I dont have a static place to put this on the webpage, and I want to load the iframe on top of the site's content on the top right (with ajax), which would remain visible unless I X it out at the top.
Auto-triggering the chatbox to load between page loads once its enabled (by checking the session that it wrote when the chatbox was first enabled) would also be nice.
I use the jquery framework, but Im not that proficient at it. Site is written in php.
What I was thinking is this
I have an empty div with id chatbox. When someone clicks a link to see the chatbox, it loads chat.php inside that div in an iframe, and adds a class to the div that would position the div in the top right corner.
<style type="text/css">
#chatFrame {
display: none;
width: 300px;
height: 200px;
/* some more styles */
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#activator').click(function() {
$('#chatFrame').html('<iframe border="0" frameborder="0" width="100%" height="100%" src="chat.php"></iframe>').show();
});
});
</script>
open chat
<div id="chatFrame"></div>
A simple and very neat solution : use PrettyPhoto (or any other lightbox style) plugin.
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
I like PrettyPhoto for it's simple look and so far I had no problem with it.
The code can be as simple as this :
Google.com
The website has all the details.