can't include the .php file properly - php

I am trying to include different php files in the index.php file
on my webpage
http://www.e-lang.de/index.php
but the contents are included as simple text. What I want is that they should be proper DOM elements not the text.
here is my index.php
<div class="container">
<div class="navbar mt10">
<div class="navbar-inner">
اردو ایڈیٹر
<ul class="nav">
<li class="active">صفحۂ اول</li>
<li>رابطہ</li>
</ul>
</div>
</div>
<?php include_once "editor.php"; ?>
<!-- hidden inline form -->
<?php include_once "emailform.html"; ?>
</div>
and editor.php looks like
<div class="well widget">
<div class="widget-header">
<h3 class="title">اُردوھے جس کا نام</h3>
</div>
<div class="row">
<div class="span7">
<form method="post" action="save.php" id="text-container">
<input type="hidden" name="save" value="0" id="savetext">
<textarea rows="22" id="text-urdu" name="text" class="span7" dir="rtl" style="font: normal 25px Arial"></textarea>
</form>
<div class="rel">
<div id="counter"></div>
</div>
</div>
<div class="span4" id="help-wrapper">
</div>
</div>
<div class="row">
<div class="span11">
<div class="well widget" id="buttons-listing">
<ul class="listing">
<li>Print</li>
<li>Save</li>
<li>pdf</li>
<li></li>
<li><a href="#" class="button" id="btn_email" >E-Mail</a></li>
</ul>
</div>
</div>
</div>
</div>

There is no actual PHP in editor.php. Please remove the first line (containing the PHP open tag, <?php) from the editor.php file, as that should only surround PHP code. For standard HTML, you don't need to use the <?php tag.

Related

Form is not working in laravel master layout

What i am trying to do is to submit my form but this form is not working.
If i run this code without extending my layout file its work but inside this code form is not working.
Can you check my code and tell my mistake.
Thanks in advance
Form.blade.php
#extends('layouts.login')
#section('title')
TSI(New Buyer)
#endsection
#section('page-header')
BUYER
#endsection
#section('breadcrumb1')
Marketing
#endsection
#section('breadcrumb2')
Add new buyer
#endsection
#section('content')
<form method="POST" action="{{route('inquiry.store')}}">
{{ csrf_field()}}
<input type="text" name="name">
<input type="submit" value="submit">
</form>
#endsection
Layout file that contain the master layout
login.blade.php
<!DOCTYPE html>
<html class="no-js" lang="">
<head>
#include('include.head')
</head>
<body class="theme-blush">
<!-- Page Loader -->
<div class="page-loader-wrapper">
<div class="loader">
<div class="m-t-30"><img class="zmdi-hc-spin" src="{{asset('assets/images/loader.svg')}}" width="48" height="48" alt="Aero"></div>
<p>Please wait...</p>
</div>
</div>
<!-- Overlay For Sidebars -->
<div class="overlay"></div>
#include('include.sidebar')
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<!-- Main Content -->
<section class="content">
<div class="body_scroll">
<div class="block-header">
<div class="row">
<div class="col-lg-7 col-md-6 col-sm-12">
<h2> #yield('page-header')</h2>
<ul class="breadcrumb">
<li class="breadcrumb-item"><i class="zmdi zmdi-home"></i> TSI</li>
<li class="breadcrumb-item">#yield('breadcrumb1')</li>
<li class="breadcrumb-item active">#yield('breadcrumb2')</li>
</ul>
<button class="btn btn-secondary btn-icon mobile_menu" type="button"><i class="zmdi zmdi-sort-amount-desc"></i></button>
</div>
<div class="col-lg-5 col-md-6 col-sm-12">
#yield('plus-btn')
</div>
</div>
</div>
<div class="container-fluid">
#yield('content')
</div>
</div>
</section>
#include('include.script')
</body>
</html>

CSS row broken after including php page in html

i have a problem with css row and columns, when i include php file in html my columns only arrange vertically
this is for my dashboard website, and i have try to find solution but no luck
when i put code like this
<div class="row">
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
</div>
Works perfectly with column size and placement
(screen shot: https://ibb.co/tqRvBtL)
but when i include php page like this
<div class="row">
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<?php include 'php/user-list.php';?>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
<div class="col-md-4" id="list">
<div class="bg-mattBlackLight my-2 p-4">
<h1>HELLO</h1>
</div>
</div>
</div>
the columns arrange is vertical
(screen shot: https://ibb.co/Q6qQJDJ)
Dose anybody know what is wrong?
Make sure you have closed all the open tags inside PHP files

Inheriting files in specific div through php files

I've created a file called menu.php to be my universal nav/menu file. The way it was created using bootstrap though, I have a div called article at the bottom which serves as the main body of the app, since the sidebar in my menu is expandable/responsive.
I really want to have one global menu file. I'm currently including it in all of my content pages like so:
<?php include("menu.php")?>
This works but it breaks my formatting. What I'm trying to do is make all of my main pages such as index.php have the html formatted so that it will always sit inside the tag in my code below which shows card classes.
<header>
<div class="branding">
<div class="menu-button menu-toggle nav">
<i class="material-icons">menu</i>
</div>
<img src="" />
</div>
<div class="page-details">
</div>
<div class="settings">
<div class="menu-button profile">
<i class="far fa-user-circle fa-2x"></i>
</div>
<div class="menu-button menu-toggle aside">
<i class="material-icons">chat</i>
</div>
</div>
</header>
<div class="app">
<nav>
<div class="title-block">
<img src="" />
</div>
<ul>
<li><a href="#"><i class="material-icons">home</i>
<span>Home</span></a></li>
</ul>
</nav>
<!--This following article section is the main body of the page, that I want each additional page to take up-->
<article>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
</article>
</div>
Example:
Menu.php is my global menu/nav file but it makes the page/app act as a wrapper for all the other pages (index.php, editor.php, etc.)
menu.php
<div class="app">
<nav>
Nav menu content
</nav>
<article>
This will be the main page article for index.php, editor.php,etc.
</article>
</div>
example with index.php (the start and end are just hypothetical to show the endpoints)
<body>
<?php include("menu.php");?>
<?php start('article') ?>
<!--Everything from here to the end() call would be inserted in the article tags on menu.php-->
<div class="app">
<div id="content">
<div>
<h1 style="text-align: center; color: #A9BD50; ">Content Management Editor</h1>
</div>
<form method="post">
<textarea id="mytextarea"></textarea>
</form>
<div>
<h1 style="text-align: center; color: #A9BD50; ">Preview</h1>
</div>
</div>
</div>
<?php end() ?>
</body>

Enabling panel when php gets executed unless its hidden

I using php to display result to my page and I did a bit of styling using bootstrap
<div class="alert alert-success" role="alert">
<?php
if(isset($_POST['submit'])){ //check if form was submitted
include "assets/backend/newsletter.php";
}
?>
</div>
Even the php code is not executed I can see the blank panel.
How can I get rid of that?
[Image for reference.][1]I think on ur case this makes way much more sens then what are u doing up there:
<?php
if(isset($_POST['submit'])){ ?>
<div class="alert alert-success" role="alert">
<?php include "assets/backend/newsletter.php"; ?>
</div>
<?php}?>
This way if the form was submitted the panel will appear if not submitted the panel will not be visible.
footer.php
<div class="container">
<div class="row">
<?php
if(isset($_POST['submit'])){
echo '<div class="alert alert-success" role="alert"> ';
include 'assets/backend/newsletter.php';
echo '</div>';
}
?>
</div>
<div class="container-fluid" style="background-color:#222222">
<div class="row">
<div class="container" style="margin-top:15px;
margin-bottom:15px">
<div class="col-lg-4" style="color:#f3f6f9">
<img src="images/pc%20logo.png" width="80px" height="80px">
<h4 >
PLACEMENT
<cell style="font-weight:bold">CELL</cell>
</h4>
<p>Nehru Nagar, Ring Road <br>New Delhi <br>
Ph :(+91) 964 328 0581<br>
Email : placements.pgdav#gmail.com
</p>
<a href="https://www.facebook.com/pgdavplacements"> <img src="images/f.png" height="30px" width="30px" >
</a>
<img src="images/i.png" height="30px" width="30px">
<img src="images/linkedin.png" height="30px" width="30px">
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:30px">
<h4>Subscribe to Our Newsletter</h4>
<form action=" " method="post">
<div class="form-group">
<input class="form-control" type="text"
id="inputemail" name="email_newsletter" placeholder="Your Email ID">
</div>
<input type="submit" name="submit" class="btn btn-default" value="subscribe">
</form>
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:29px">
<h4>Links</h4>
<ol class="breadcrumb">
<li>Home</li>
<li>About Cell</li>
<li>Registration</li>
<li>Contact Us</li>
</ol>
</div>
</div>
<div class="container-fluid" style="background-color:#f3f6f9">
<div class="row">
<div class="container" style="padding-top:7px">
<div class="col-lg-6 col-sm-12 col-xs-12">© All the Rights Reserved with Placement Cell</div>
<div class="col-lg-6 col-sm-12 col-xs-12" style="text-align:right">Developed By Bhanu Singh</div>
</div>
</div>
</div>
</div>
</div></div>
or this:
<div class="container">
<div class="row">
<?php
if(isset($_POST['submit'])){ ?>
<div class="alert alert-success" role="alert">
<?php
include 'assets/backend/newsletter.php';
?>
</div>
<?php
}
?>
</div>
<div class="container-fluid" style="background-color:#222222">
<div class="row">
<div class="container" style="margin-top:15px;
margin-bottom:15px">
<div class="col-lg-4" style="color:#f3f6f9">
<img src="images/pc%20logo.png" width="80px" height="80px">
<h4 >
PLACEMENT
<cell style="font-weight:bold">CELL</cell>
</h4>
<p>Nehru Nagar, Ring Road <br>New Delhi <br>
Ph :(+91) 964 328 0581<br>
Email : placements.pgdav#gmail.com
</p>
<a href="https://www.facebook.com/pgdavplacements"> <img src="images/f.png" height="30px" width="30px" >
</a>
<img src="images/i.png" height="30px" width="30px">
<img src="images/linkedin.png" height="30px" width="30px">
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:30px">
<h4>Subscribe to Our Newsletter</h4>
<form action=" " method="post">
<div class="form-group">
<input class="form-control" type="text"
id="inputemail" name="email_newsletter" placeholder="Your Email ID">
</div>
<input type="submit" name="submit" class="btn btn-default" value="subscribe">
</form>
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:29px">
<h4>Links</h4>
<ol class="breadcrumb">
<li>Home</li>
<li>About Cell</li>
<li>Registration</li>
<li>Contact Us</li>
</ol>
</div>
</div>
<div class="container-fluid" style="background-color:#f3f6f9">
<div class="row">
<div class="container" style="padding-top:7px">
<div class="col-lg-6 col-sm-12 col-xs-12">© All the Rights Reserved with Placement Cell</div>
<div class="col-lg-6 col-sm-12 col-xs-12" style="text-align:right">Developed By Bhanu Singh</div>
</div>
</div>
</div>
</div>
</div></div>
tested both options are workin;

HTML, CSS, I dont know whats wrong with my code

I don't know what wrong with my code but it wont display the position i want.
Here's the output:
Output of my code
And here's my code:
<!DOCTYPE html>
<html>
<head>
<title>Escapade Travel & Tours</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.css" rel="stylesheet">
<!--Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Duru+Sans|Actor' rel='stylesheet' type='text/css'>
<link href="css/bootshape.css" rel="stylesheet">
</head>
<body>
<!-- Navigation bar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="Home.html"><span class="green">Escapade</span> Travel & Tours</a>
</div>
<nav role="navigation" class="collapse navbar-collapse navbar-right">
<ul class="navbar-nav nav">
<li class="active">Home
</li>
<li class="dropdown">
<a data-toggle="dropdown" href="#" class="dropdown-toggle">Destination <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>Boracay
</li>
<li class="active">Palawan
</li>
<li>Cebu
</li>
<li class="divider"></li>
<li>All Destinations
</li>
</ul>
</li>
<li>Special Offers
</li>
<li>Book Now!
</li>
<li>Contact Us
</li>
</ul>
</nav>
</div>
</div>
<!-- End Navigation bar -->
<!-- Content -->
<div class="container">
<div style="clear: both; height:40px;"></div>
<div style="clear: both; height:15px;"></div>
<div style="clear: both; height:15px;"></div>
<div id="cont_razd">
<div id="right">
<h1>Meet Us</h1>
<div style="height:15px;"></div>
<div class="box_us">
<div class="box_us_r">
<img src="img/fish_us1.gif"> Quezon City, Philippines</div>
<div style="clear: both; height:15px;"></div>
<p>
<img src="img/fish_us2.gif"> Telephone: 02-1234567</p>
<div style="clear: both; height:15px;">
<p> Cellphone: 0912-345-6789</p>
<div style="clear: both; height:15px;"></div>
</div>
</div>
<div class="box_us">
<div class="box_us_l"></div>
<div class="box_us_r">
<div class="box_us_r">
<div style="clear: both; height:15px;"></div>
<img src="img/fish_us3.gif" alt="" /> Email Add: escapadetravelandtours#yahoo.com</div>
</div>
</div>
<div class="box_us">
</div>
<div style="height:25px;"></div>
<b> <i> Book us now and get very good rates! :) </b>
</i>
<br/>
</div>
<div id="left">
<h1>Contact Us</h1>
<div style="clear: both; height:15px;"></div>
<?php echo "<form action=" " method="post ">
<b> Name: </b> <br>
<input type=text size=40 name="ContactName ">
<br> <br> <b> E-mail Address: </b> <br>
<input type=text size=40 name="ContactEmail ">
<br> <br> <b> Subject: </b> <br>
<input type=text size=40 name="ContactSubject ">
<br> <br> <b> Message: </b> <br>
<textarea cols=40 rows=5 input type=text size=150 name="ContactMessage "> </textarea>
<br> <br>
<input type="Submit " name="Send " value="Send ">
<input type="Reset " name="Reset " value="Reset ">" ?>
<div style="clear: both"></div>
</div>
</div>
</div>
<!-- End Content -->
<!-- Footer -->
<div class="footer text-center">
<p>© 2016. All Rights Reserved. Created by</p>
</div>
<!-- End Footer -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootshape.js"></script>
</body>
</html>
I want the meet us to be place in the right while the contact us is in the left but it wont place to where i indicate them.
I have put <div id="right"> in meets us and <div id="left"> in contact us.
I'm using notepad ++ here.
This is my expected output
Please help. Thanks!
Just add this css will make as per your expected result:
#left {
float: left;
}
#right {
float: right;
}
Working Fiddle
You can try below code:
<div class="clearfix">
<div class="col-lg-6 col-md-6 col-sm-6">
left
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
right
</div>
</div>
use bootstrap girds see example of bootstrap girds see here also
you could use
<div class="row">
<div class="col-lg-9">
Your Left content
</div>
<div class="col-lg-3">
Your right content
</div>
</div>
the easiest way, while you use Bootstrap..
You have included bootstrap anyway in your code.. So you can use the bootstrap class.
<div class="row>
<div class="col-lg-6 col-xs-12">
<!-- Put your contact Us div here -->
</div>
<div class="col-lg-6 col-xs-12">
<!-- Put your meet Us div here -->
</div>
</div>
div id = "right"
does not place your div to the right, it just gives it an id.
Enclose both the divs in a
div class = "row"
and then the child divs using column span.
Learn about the bootstrap grid system here:-
http://www.w3schools.com/bootstrap/bootstrap_grid_system.asp
Put the "Contact Us" div before the "Meet Us" div. Then Apply float:left; to both the element. Try to avoid float:right; as much as possible.
Otherwise you can use use display:inline-block to both the divs. Will work just like float and on top of that you can even align them vertically.

Categories