Form that sends html template to email - php

The form contents are sent to my email but HTML and CSS code is not recognised on the email. Only plain text is outputted.
Below is my controller
public function registration() {
$email = $this->input->post('email');
$domain = $this->input->post('domain_name');
$passw = $this->input->post('passw');
$name = $this->input->post('name');
$skype = $this->input->post('skype');
// $package = $this->input->post('package');
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'xxxx.com',
'smtp_port' => 25,
'smtp_user' => 'xxx#xxxxxx.com',
'smtp_pass' => 'xxxxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('xxx#xxxxxx.com', 'welcome');
$this->email->to('xxxxx#xxxxxxxx.com');
$this->email->subject('registration');
$body = $this->load->view('dns/template', TRUE);
$this->email->message($body, TRUE);
$this->email->send();
$data['message'] = 'Submitted Sucessfullly';
$data['emails'] = $this->Dns_model->emails($domain);
$this->load->view('dns/sucessful', $data);
}
Below is my view saved as template.php
My view (template)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Registration</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/bootstrap.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/main.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/style.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/AdminLTE.css">
<link rel="stylesheet" href="<?php echo base_url()?>/assets/css/sl-slide.css">
<script src="<?php echo base_url()?>/assets/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js'></script>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<?php echo base_url()?>/images/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo base_url()?>/images/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url()?>/images/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="i<?php echo base_url()?>/mages/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo base_url()?>/images/ico/apple-touch-icon-57-precomposed.png">
</head>
<body id="con" onLoad="generate();">
<div id="fb-root"></div>
<div class="container">
<section class="main-info">
<br>
<section id="recent-works3">
<section id="pricing-table">
<div class="row-fluid center clearfix">
<div class="span3">
</div>
<div class="span6">
<ul class="plan plan3">
<li class="plan-name">
<span class="lead3">Emails to be setup</span>
</li>
</ul>
<table class="table">
<thead>
<tr>
<th>Email</th>
<th>Password</th>
</tr>
</thead>
<tbody>
<tr class="info">
<td>info#test.com</td>
<td>terfwws6w</td>
</tr>
</tbody>
</table>
<ul class="plan plan3">
<li class="plan-action">
Registration website
</li>
</ul>
</div>
<div class="span3">
</div>
</div>
</section>
</section>
</section>
</div>
</div>
<script src="<?php echo base_url()?>/assets/js/vendor/jquery-1.9.1.min.js"> </script>
<script src="<?php echo base_url()?>/assets/js/vendor/bootstrap.min.js"></script>
<script src="<?php echo base_url()?>/assets/js/main.js"></script>
<script src="<?php echo base_url()?>/assets/js/jquery.ba-cond.min.js"></script>
</body>
</html>

I hope you are not using Parser library for email template, so bellow is my Answer by considering the above Condition.
You have problem with your template, means the Html code you wrote there, they have mismatched tag or some tag used in Wrong place. So you have to check that first.
If still you are not able to find out the problem then you just create a template using bellow code and You will see that the mail not more in normal text..
Nice, You nailed it...
NOTE: Don't use or etc tag and Also Use <table> instead of <div>

Related

problem with the path of the uploads folder to the host

I have an "uploads" folder that according to the database with php and mysql shows some videos, the problem is that in localhost it works, but when I insert the files in the file manager of the host (000webhost), the host cannot recognize the path "uploads", this is full code, the problem is in the video src at the end of the code.
<?php
require_once("config.php");
$result=' ';
$cerca=$_POST["cerca"];
$sql = "SELECT * FROM artisti WHERE nome like '%".$cerca."%'";
$result = $conn->query($sql);
if ($result->num_rows > 0)
{
//echo "<h1>Artisti trovato</h1>";
while ($row = $result->fetch_assoc()) {
$ID=$row["ID"];
$nome=$row["nome"];
$link=$row["link"];
$album=$row["album"];
//echo "<h2>ID: "."$ID"."</h2>";
//echo "nome: "."$nome"."<br>";
}
}
else {
echo "nessun artista trovato";
$conn->close();
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Utopia-Playlist</title>
<!--Reset css per ogni broswer-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" integrity="sha512-NmLkDIU1C/C88wi324HBc+S2kLhi08PN5GDeUVVVC/BVt/9Izdsc9SVeVfA1UZbY3sHUlDSyRXhCzHfr6hmPPw==" crossorigin="anonymous" />
<!--Script scroll-->
<script src="https://unpkg.com/scrollreveal#4.0.0/dist/scrollreveal.min.js"></script>
<!--Icone-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<!--Icona tab di google-->
<link rel="icon" href="Fulmine viola bianco.png">
<link rel="stylesheet" href="hero.css">
<link rel="stylesheet" href="nav.css">
<link rel="stylesheet" href="playlist1.css">
<style>
#import url('https://fonts.googleapis.com/css2?family=Overpass&display=swap');
</style>
</head>
<body>
<!--NavBar-->
<header class="he">
<h1 class="developers">Utopia Playlist</h1>
<nav>
<div class="listanav">
<li class="icon">Home</li>
<li>Playlist <i class="fas fa-caret-down"></i>
<ul class="submenu">
<li>Consigli</li>
<li>
Consigli-DV
</li>
<li> Top 50</li>
</ul>
</li>
<li>Contattaci</li>
</div>
</div>
</nav>
<button type="button" class="accedi">Accedi</button>
</header>
<!--Hero--> <!-- class="btn" -->
<div class="hero">
<div class="hero-cn scroll">
<p class="intro-text">ASCOLTA I NOSTRI CONSIGLI!</p>
<?php echo "<h1 class=grande-text>"."$nome"."</h1>"?>
<?php echo "<a class=btn href=$album>Scopri di più</a>" ?>
</div>
<video autoplay muted loop class="vd">
<source src="uploads/<?php echo $link?>" type="video/mp4" >
</video>
</div>
maybe there are some that you should check again:
The $link variable hasn't gotten the value it got
Placement of folders is not the same right
Check the connection whether it is connected to the hosting database or not

Bulk Email Validator works but not properly

I wish to either make use of a freely available email validator (software, script or online service). There's work but when I insert more than one email at that time only one email verifies which I insert last and other email does not verify. Only one email verifies. How can I do it?
My code:
<?php
include_once('config.php');
if(isset($_POST["email_verify_btn"])) {
$email = $_POST["email_verify"];
if(strpos($email,"\n")) {
$text = explode("\n",$email);
} else {
$text = array($email);
}
function domain_exists($text)
{
$domain = substr(strrchr($text, "#"), 1);
$arr = #dns_get_record($domain, DNS_MX);
if ($arr[0]['host'] == $domain && !empty($arr[0]['target'])) {
return $arr[0]['target'];
}
}
foreach ($text as $abc) {
$domain = "";
$target = "";
$target_ip = "";
if(filter_var($abc, FILTER_VALIDATE_EMAIL)) {
if(domain_exists($abc)){
$domain = substr(strrchr($abc, "#"), 1);
$data = #dns_get_record($domain, DNS_MX);
if (is_array($data) || is_object($data)) {
foreach ($data as $key1) {
$host = $key1['host'];
$target = $key1['target'];
$target_ip = gethostbyname($key1['target']);
}
}
if($data) {
$status = "email id is valid";
}
} else {
$status = "mx recored not exist";
}
} else {
$status = "not in syntax";
}
$c_by = 1;
$c_date = date('Y-m-d H:i:s');
$c_ip = $_SERVER['REMOTE_ADDR'];
$insert = $connect->query("INSERT INTO `email_verify_list`(`primary_email`,`host_name`,`target`,`target_ip`,`session`,`status`,`created_by`, `created_date`, `created_ip`) VALUES ('$abc','$domain','$target','$target_ip','$c_date','$status','$c_by','$c_date','$c_ip')");
if($insert == 1) {
$_SESSION['date_time'] = $c_date;
} else {
echo "<script>alert('!!!!!not successfully');</script>";
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta charset="utf-8"/>
<title>BULK EMAIL VARIFIER</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/>
<link rel="apple-touch-icon" href="pages/ico/60.png">
<link rel="apple-touch-icon" sizes="76x76" href="pages/ico/76.png">
<link rel="apple-touch-icon" sizes="120x120" href="pages/ico/120.png">
<link rel="apple-touch-icon" sizes="152x152" href="pages/ico/152.png">
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta content="" name="description"/>
<meta content="" name="author"/>
<link href="assets/plugins/pace/pace-theme-flash.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/bootstrapv3/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/jquery-scrollbar/jquery.scrollbar.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="assets/plugins/switchery/css/switchery.min.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="pages/css/pages-icons.css" rel="stylesheet" type="text/css" />
<link class="main-stylesheet" href="pages/css/pages.css" rel="stylesheet" type="text/css"/>
<!--[if lte IE 9]>
<link href="assets/plugins/codrops-dialogFx/dialog.ie.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
</head>
<body class="fixed-header ">
<div id="rootwizard" class="m-t-50">
<ul class="nav nav-tabs nav-tabs-linetriangle nav-tabs-separator nav-stack-sm">
<li class="active">
<a data-toggle="tab" href="#tab1"><span>EMAIL VERIFY</span></a>
</li>
</ul>
<form method="post" action="" >
<div class="tab-content">
<div class="tab-pane padding-20 active slide-left" id="tab1">
<div class="row row-same-height">
<div class="col-md-12">
<div class="padding-30">
<div class="row clearfix">
<div class="col-sm-3">
<div class="form-group form-group-default">
<label><font size="2">ENTER YOUR EMAIL <span class="glyphicon glyphicon-envelope"></span></font></label><br>
<textarea cols="43" rows="9" name="email_verify" style="border-color:white;border-width:thin;padding:4pt;" multiple/></textarea><br>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-3">
<button type="submit" name="email_verify_btn" class="btn btn-lg btn-info" style="padding:11pt;width:200px;"/><span><b><font size="2">SUBMIT</font></b></span></button>
</div>
</div> <br><br>
<div class="row clearfix">
<div class="col-sm-12">
<table width="100%" class="table ">
<tr class="success">
<th>PRIMARY EMAIL <span class="glyphicon glyphicon-envelope"></span></th>
<th>HOST NAME</th>
<th>TARGET</th>
<th>TARGET IP</th>
<th>STATUS</th>
</tr>
<?php
$select = $connect->query("SELECT * from `email_verify_list` where session='".$_SESSION['date_time']."' order by id");
while($row = $select->fetch_assoc()) {
?>
<tr>
<td><?php echo $row['primary_email']; ?></td>
<td><?php echo $row['host_name']; ?></td>
<td><?php echo $row['target']; ?></td>
<td><?php echo $row['target_ip']; ?></td>
<td><?php echo $row['status']; ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<script src="assets/plugins/pace/pace.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="assets/plugins/modernizr.custom.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrapv3/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery/jquery-easy.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-unveil/jquery.unveil.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-bez/jquery.bez.min.js"></script>
<script src="assets/plugins/jquery-ios-list/jquery.ioslist.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-actual/jquery.actual.min.js"></script>
<script src="assets/plugins/jquery-scrollbar/jquery.scrollbar.min.js"></script>
<script type="text/javascript" src="assets/plugins/classie/classie.js"></script>
<script src="assets/plugins/switchery/js/switchery.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap3-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script type="text/javascript" src="assets/plugins/jquery-autonumeric/autoNumeric.js"></script>
<script type="text/javascript" src="assets/plugins/bootstrap-tag/bootstrap-tagsinput.min.js"></script>
<script type="text/javascript" src="assets/plugins/jquery-inputmask/jquery.inputmask.min.js"></script>
<script src="assets/plugins/bootstrap-form-wizard/js/jquery.bootstrap.wizard.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="assets/plugins/summernote/js/summernote.min.js" type="text/javascript"></script>
<script src="assets/plugins/moment/moment.min.js"></script>
<script src="assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
<script src="assets/plugins/bootstrap-timepicker/bootstrap-timepicker.min.js"></script>
<script src="pages/js/pages.min.js"></script>
<script src="assets/js/form_wizard.js" type="text/javascript"></script>
<script src="assets/js/scripts.js" type="text/javascript"></script>
<script src="assets/js/demo.js" type="text/javascript"></script>
<script>
window.intercomSettings = {
app_id: "xt5z6ibr"
};
</script>
</body>
</html>
I think , you are not using strpos function in correct way.
you can use this way . Because strpos return also 0 value if any string found at zero position . and return FALSE if search string not found
Also note that string positions start at 0, and not 1.
if(strpos($email,"\n")!==false) {
$text = explode("\n",$email);
} else {
$text = array($email);
}

CodeIgniter Head Empty and content in body

Hey i don't understand my website doesn't work i have don't do anything so i will explain
I got a 0 in top on my page now!
Google Chrome Explorator:Screenshot
https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.wisementrade.com%2F
View/header.php: https://pastebin.com/7GqFYR75
View/homepage.php: https://pastebin.com/3htmFSmw
View/footer.php: https://pastebin.com/b3X9KScg
Controller/View.php: https://pastebin.com/cxCdcdEQ
Chrome viewer code: https://pastebin.com/Q8VYja5u
I have check the encode UTF-8 and i have re encode UTF-8 with my sublime text but nothing change ... please need help
EDIT: FIXED
I guess unclosed HTML tag cause this problerm. I found a few unclosed HTML tag in your View/header.php. Close it. try this.
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--o-->
<?php
//Session
$customer_id = $this->session->userdata('customer_id');
$user_type = $this->session->userdata('user_type');
$statement = $this->session->userdata('timezone');
?>
<!--o-->
<link rel="icon" type="image/png" href="<?php echo base_url('images/favicon.png'); ?>" />
<meta name="author" content="Wise Men Trade" />
<meta name="copyright" content="Copyright Notice ©2015 WisemenTrade Limited and licensors. All rights reserved." />
<meta name="robots" content="all" />
<!--o-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script language="JavaScript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Bootstrap CSS -->
<link href="<?php echo base_url("css/bootstrap.min.css"); ?>" rel="stylesheet"/>
<!-- Basic CSS -->
<link href="<?php echo base_url("css/style.css"); ?>" rel="stylesheet"/>
<!-- Responsive CSS -->
<link href="<?php echo base_url("css/responsive.css"); ?>" rel="stylesheet"/>
<!-- Important Owl stylesheet -->
<link rel="stylesheet" href="<?php echo base_url("css/owl-carousel/owl.carousel.css"); ?>"/>
<!-- Default Theme -->
<link rel="stylesheet" href="<?php echo base_url("css/owl-carousel/owl.theme.css"); ?>"/>
<!-- MS DROP DOWN -->
<link rel="stylesheet" href="<?php echo base_url('css/msdropdown/flags.css'); ?>"/>
<link rel="stylesheet" href="<?php echo base_url('css/msdropdown/dd.css'); ?>"/>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-62333409-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
</head>
<body>
<!--top-header-->
<header>
<div class="header_block">
<!-- left -->
<div class="block_left">
<a href="<?php echo base_url(); ?>">
<img src="<?php echo base_url("images/log_wmt.png"); ?>" class="logo" width="130" height="130" alt="Logo Wise Men Trade" />
</a>
</div>
</div>
</header>
also in your Controller/View.php have a few unclosed div (<div id="container"> and <div class="block_content">). check it and close it.
the last, make sure at the end of your Controller/View.php have a :
</body> <!-- end of body -->
</html> <!-- end of html -->
According to the documentation (https://www.codeigniter.com/user_guide/general/views.html), you could load multiple views in your controller, I think it doesn't work if you load it in the view, so you should have something like this:
<?php
class Page extends CI_Controller {
public function index()
{
$data['page_title'] = 'Your title';
$this->load->view('header');
$this->load->view('menu');
$this->load->view('content', $data);
$this->load->view('footer');
}
}

Fancybox video pop-up in Wordpress?

I have a page here: http://desertcinema.com/home-test/
And I want to add a fancybox for both video (youtube and vimeo) and image gallery for photos under my portfolio section using fancybox.
Since I am working on Wordpress site (custom page). I access header.php file and added the cdn links for both the jQuery and CSS of fancybox:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css" type="text/css" media="screen" />
Here's the header.php file:
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]>
<!--><html <?php language_attributes(); ?>><!--<![endif]-->
<?php
global $theme_option;
global $wp_query;
$seo_title = get_post_meta($wp_query->get_queried_object_id(), "_cmb_seo_title", true);
$seo_description = get_post_meta($wp_query->get_queried_object_id(), "_cmb_seo_description", true);
$seo_keywords = get_post_meta($wp_query->get_queried_object_id(), "_cmb_seo_keywords", true);
?>
<head>
<!-- Basic Page Needs
================================================== -->
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title><?php bloginfo('name'); ?> <?php is_front_page() ? bloginfo('description') : wp_title(''); ?></title>
<meta name="author" content="<?php if(isset($theme_option['text_facebook']) && $theme_option['text_facebook'] != ''){echo $theme_option['text_facebook'];}else{echo 'Vergatheme';} ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<?php if($seo_description!="") { ?>
<?php }elseif($theme_option['seo_des']){ ?>
<meta name="description" content="<?php echo $theme_option['seo_des']; ?>">
<?php } ?>
<?php if($seo_keywords!="") { ?>
<meta name="keywords" content="<?php echo $seo_keywords; ?>">
<?php }elseif($theme_option['seo_key']){ ?>
<meta name="keywords" content="<?php echo $theme_option['seo_key']; ?>">
<?php } ?>
<!-- CSS
================================================== -->
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="<?php echo $theme_option['favicon']['url']; ?>" type="image/png">
<link rel="apple-touch-icon" href="<?php echo $theme_option['apple_icon']['url']; ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?php echo $theme_option['apple_icon_72']['url']; ?>">
<link rel="apple-touch-icon" sizes="114x114" href="<?php echo $theme_option['apple_icon_114']['url']; ?>">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css" type="text/css" media="screen" />
<?php wp_head(); ?>
Now on my HTML I tried to add this codes here as per instruction:
To the wrap image to make sure it appears:
<li class="portfolio-box video-production ">
<a href="https://vimeo.com/169312968" class="more">
<img src="http://desertcinema.com/wp-content/uploads/bfi_thumb/ilive-1-31nhrb4atwt3ix3v5bwef4.jpg" alt="" />
<div class="mask"></div>
<div class="line-folio"></div>
<div class="line-folio1"></div>
<h4>iLiveAccountable</h4>
</a>
</li>
Now to finally make it work I created a script which I place at the footer of my custom page:
<script>
$("a.more").click(function() {
$.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 680,
'height' : 495,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
});
return false;
});
</script>
However when I tried it, it just link me to the link i place inside the link i presented:
Any idea what I am doing wrong? I really need to show up a responsive pop up/ligthbox for each image both video and image gallery.
Thanks in advance for the help.
The jquery plugin is not there. Check the console for error. Place it above the fancybox

How can I incorporate inline CSS styles and stylesheets relating to one page only when using the PHP 'header'?

I have a 'header.php' file and I am incorporating it into my html pages using the following code:
<?php /*
$pageTitle = "Home";
$section = "Home";
include('inc/header.php');
?>
The PHP header file contains a number of CSS stylesheets. Some of these CSS stylesheets I only want to include on one page - e.g. I only want to include 'index.css' on the page 'index.php'. How can I include these stylesheets when I am using the same 'header.php' file in every page of the site?
Is there a way of specifying these styles in the individual pages themselves, rather than in the header file? If so, can these styles be placed in another element, even if the element has already been used (opened and closed) in the header file?
Here is the code for my 'header.php' file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;">
<title><?php echo $pageTitle ?> || Young Academy </title>
<meta name="description" content="Based in Pinner in North-West London, the Young Academy has been creating the highest standard of musical and dramatic education for 30 years.">
<meta name="keywords" content="Piano, Flute, Music Theory, Singing, Violin, Concerts, Pinner, Middlesex, Harrow, Teacher">
<meta name="author" content="Barbara Young">
<!--Stylesheets!-->
<link rel="stylesheet" type="text/css" media="all" href="css/reset.css"/>
<link rel="stylesheet" type="text/css" media="all" href="css/text.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/960_16_col.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/contact.css"/>
<!--Google fonts!-->
<link rel="stylesheet" type="text/css" media="all" href="http://fonts.googleapis.com/css?family=Quicksand:400,700">
<link href='http://fonts.googleapis.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Marck+Script' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,500,500italic,400italic' rel='stylesheet' type='text/css'>
**<link rel="stylesheet" type="text/css" media="screen" href="css/index.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/bgaudioplayer.css"/>**
<!--Meta tags!-->
<meta name="author" content="Robert Young" />
<meta name="copyright" content="2013 by Robert Young" />
<meta name="keywords" content="Music lessons, Pinner, music tuition, piano lessons, speech and drama, London" />
<meta name="description" content="Site of the Young Academy, a private music tuition business based in Pinner" />
<script src="../js/modernizr.custom.63826.js"></script>
<script src="../js/html5shiv.js"></script>
</head>
<body>
<div class="header">
<div class="container_16 clearfix">
<ul class="nav grid_16 alpha">
<li><a class="<?php if ($section == "Home") {echo "here"; } ?>" href="index.php" accesskey="1"> Home </a></li>
<li><a class="<?php if ($section == "About Us") {echo "here"; } ?>" href="about_us.php" accesskey="2"> About </a></li>
<li><a class="<?php if ($section == "What We Do") {echo "here"; } ?>" href="what_we_do.php" accesskey="3"> What We Do </a></li>
<li><a class="<?php if ($section == "Enrolement") {echo "here" ; } ?>" href="enrolement.php" accesskey="4"> Enrolement </a></li>
<li><a class="<?php if ($section == "Contact Us") {echo "here" ; } ?>" href="contact.php" accesskey="5"> Contact Us </a></li>
<!--<li> Blog </li>-->
</ul>
<div id="logo">
<img src="img/Logo original.gif" alt="The Young Academy"/>
</div>
<div class = "grid_4 alpha">
<div class="telephone grid_4 alpha">
<img src="img/phone_icon_white.png" alt="small telephone logo" class="align-left small" />
<p> +44 (0)20 8866 3813 </P>
</div>
<div class="timezone">
<p><?php
date_default_timezone_set('Europe/London');
mktime(0,0,0,1,1,1970);
echo date('l, d F Y');
?> </p>
<!--<form action="http://www.example.com/login.php">
<p>
<input type="text name=search" size="20+" id="search" value="Search this site"
</p>
</form>!-->
</div>
</div>
<ul class="secondmenu grid_6 push_3">
<li><a class="<?php if ($section == "Musical Glossary") {echo "here" ; } ?>" href="glossary.php">Musical Glossary </a></li>
<li><a class="<?php if ($section == "FAQ") {echo "here" ; } ?>" href="faq.php">FAQ</a></li>
<ul>
</div>
I want to include the stylesheets in bold only on the index.php page. Can I include them like this:
<?php
include('inc/header.php');
?>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="css/index.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/bgaudioplayer.css"/>
</head>
<article class="content">
<p class="grid_9 alpha"><i>Outstanding vocal and instrumental tuition.</i></p>
</article>
<article class="second-content">
<p class="grid_6 alpha omega">Develop a passion for music.</p>
</article>
<article class="third-content">
<p class="grid_5 alpha omega">Become a virtuoso.</p>
</article>
etc.
Any help would be much appreciated!
Thanks,
Robert.
I have just tried the above code and it happens to work! You can include head tags in both the header.php file and the main (index.php) site file.
Cheers!
long story short you need some sort of router. but Looking at your code it seems like you may not have a firm grasp on Object Oriented Programming. what you can do though is look at the URI with $_SERVER['REQUEST_URI'] if the string is lets say /about then load in resources for about-stylesheet.css.
You can do this with an if else statement that replaces the link to your CSS and refers to the unique variable you sent for the page you want to pull the CSS in for:
<link rel="stylesheet" type="text/css" media="screen" href="
<?php
if ($pageTitle == "Home") {
echo "css/index.css";
else ($pageTitle == "SomeOtherTitle") {
echo "css/relativelnk.css";
}
?>
"/>

Categories