Inserting a link to a different page

Hello there i have found the solution for the card layout but i am facing of some of the queries ie.at the bottom of the each card layout i want to insert a link which redirects to another page i have tried it a lot but not getting it so please help me to do this.

<body>

	<!-- Wrapper -->
		<div id="wrapper">

			<!-- Header -->
				<header id="header">
					<span class="avatar"><img src="images/avatar.jpg" alt="" /></span>
					<h1>This is <strong>Visualize</strong>, a responsive site template designed by <a href="http://templated.co">TEMPLATED</a><br />
					and released for free under the Creative Commons License.</h1>
					<ul class="icons">
						<li><a href="#" class="icon style2 fa-twitter"><span class="label">Twitter</span></a></li>
						<li><a href="#" class="icon style2 fa-facebook"><span class="label">Facebook</span></a></li>
						<li><a href="#" class="icon style2 fa-instagram"><span class="label">Instagram</span></a></li>
						<li><a href="#" class="icon style2 fa-500px"><span class="label">500px</span></a></li>
						<li><a href="#" class="icon style2 fa-envelope-o"><span class="label">Email</span></a></li>
					</ul>
				</header>

			<!-- Main -->
				<section id="main">

					<!-- Thumbnails -->
						<section class="thumbnails">
							<div>
								<a href="<?php include '/job/login.php';?>"> 
									<img src="/job/12.jpg">
									<h3 font color="green"></h3>
									<a href="#">sssssssss</a>
								</a>
								<a href="/job/login.php">
									<img src="images/thumbs/02.jpg" alt="" />
									<h3>BBBBBBBBB</h3>
								</a>
							</div>
							<div>
								<a href="images/fulls/03.jpg">
									<img src="images/thumbs/03.jpg" alt="" />
									<h3>cccccccccccc</h3>
								</a>
								<a href="images/fulls/04.jpg">
									<img src="images/thumbs/04.jpg" alt="" />
									<h3>ddddddddddddd</h3>
								</a>
								<a href="images/fulls/05.jpg">
									<img src="images/thumbs/05.jpg" alt="" />
									<h3>eeee</h3>
								</a>
							</div>
							<div>
								<a href="images/fulls/06.jpg">
									<img src="images/thumbs/06.jpg" alt="" />
									<h3>ffffffffffff</h3>
								</a>
								<a href="images/fulls/07.jpg">
									<img src="images/thumbs/07.jpg" alt="" />
									<h3>ggggggggg</h3>
								</a>
							</div>
						</section>

				</section>

			<!-- Footer -->
				<footer id="footer">
					<p>&copy; Untitled. All rights reserved. Design: <a href="http://templated.co">TEMPLATED</a>. Demo Images: <a href="http://unsplash.com">Unsplash</a>.</p>
				</footer>

		</div>

	<!-- Scripts -->
		<script src="assets/js/jquery.min.js"></script>
		<script src="assets/js/jquery.poptrox.min.js"></script>
		<script src="assets/js/skel.min.js"></script>
		<script src="assets/js/main.js"></script>

</body>

Which links in the above code are not working as you expect?

Hello there this the image of the post i have inserted just now the query here to me is that the text written below of the image should be in the form of a link for example if a user clicks on the text ie.aaaaaa he would be redirected to the next page.

You do know how to use an anchor tag <a> and href attribute, donā€™t you?

1 Like

Do you mean the text in the <h3> tags? At the moment, they are wrapped in an <a> link together with the image, so you would need to wrap the image in one link (if thatā€™s what you require) and the text in another to be able to have them link to different destinations.

ya i have tried but its not working. The php file is inside of the folder name as
C:\xampp\htdocs\job\templated-visualize\index.php
and i want to access
C:\xampp\htdocs\job\login.php

What is in login.php?
Is that an actual login script, or does is contain nothing but a path to the login script?
Why is it an include?

<a href="<?php include '/job/login.php';?>"> 
	<img src="/job/12.jpg">
	<h3 font color="green"></h3>
	<a href="#">sssssssss</a>
</a>

You canā€™t nest one link inside another like that.

login.php is the name of the file on which i want to redirect the page on clicking the text which is located inside of C:\xampp\htdocs\job.ā€¦

I donā€™t think it should be an include, just a normal url.

<a href="job/login.php" title="Log in">

Assuming that is the correct relative path from the current page.

1 Like

I have tried both of the same but its not fetching theb login.php folder hereā€™s the image when i click on the text ie.ssssssssss some what appears like this

C:\xampp\htdocs\job\templated-visualize\index.php

Is this the script where the links are?

C:\xampp\htdocs\job\login.php

and this the target for the link?

If so try:-

<a href="../login.php" title="Log in">

same error appears

Have you fixed the error of nested links?

Is the correct href set on the link around the ssssssssss text?

Yes I have got a little bit of change that is if i cilck on any of the image then the photo of another images appears in the same

OK, if youā€™ve changed the code, then please post the latest version, so we can see the changes.

1 Like

hereā€™s the code

				<section id="main">

					<!-- Thumbnails -->
						<section class="thumbnails">
							<div>
							<a>
								 <img src="/job/12.jpg" alt=""/>
					<a href="../login.php" title="Log in"> abc</a>
                                      
								 
                                 										
									
									
									
									<a href="images/fulls/02.jpg">
									<img src="images/thumbs/02.jpg" alt="" />
									<h3>BBBBBBBBB</h3>
								</a>
							</div>
							<div>
								<a href="images/fulls/03.jpg">
									<img src="images/thumbs/03.jpg" alt="" />
									<h3>cccccccccccc</h3>
								</a>
								<a href="images/fulls/04.jpg">
									<img src="images/thumbs/04.jpg" alt="" />
									<h3>ddddddddddddd</h3>
								</a>
								<a href="images/fulls/05.jpg">
									<img src="images/thumbs/05.jpg" alt="" />
									<h3>eeee</h3>
								</a>
							</div>
							<div>
								<a href="images/fulls/06.jpg">
									<img src="images/thumbs/06.jpg" alt="" />
									<h3>ffffffffffff</h3>
								</a>
								<a href="images/fulls/07.jpg">
									<img src="images/thumbs/07.jpg" alt="" />
									<h3>ggggggggg</h3>
								</a>
							</div>
						</section>

				</section>
<div>
	<a>
		<img src="/job/12.jpg" alt=""/>
		<a href="../login.php" title="Log in"> abc</a>
                                      
		
		<a href="images/fulls/02.jpg">
		<img src="images/thumbs/02.jpg" alt="" />
		<h3>BBBBBBBBB</h3>
	</a>
</div>

Now you have two links nested inside another (one of which isnā€™t closed properly). That makes no sense. You need to check your code in the validator https://validator.w3.org and fix the issues. You canā€™t expect broken code to work.

3 posts were split to a new topic: Populating fields with user data

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.