PHP Code not displaying Like same HTML code - php

I have a website, where I uploaded an index.html which is completely made of HTML code (no PHP).
I copied this code over to an PHP file index.php, furthermore I separated the header into a separate php file. When I cleaned up the new index.php, I just used an include() to include the header, like so:
<? include("TopNote.php"); ?>
So the difference between index.html and index.php is that the HTML code is directly in the index.html and in the PHP file, it is included from a seperate PHP file.
Now the index.php file give a strange button, where the index.html displays it all the way I want it to display.
index.html:
<!doctype html>
<html lang="us">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="web/style.css">
<link href="css/smoothness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<style>
.ui-menu { position: absolute; width: 100px; }
</style>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.3.custom.js"></script>
<script>
$(function() {
$( "#menu" ).buttonset();
$( "#regdialog" ).dialog();
$( "#buttonregister" ).click(function() {
$( "#regdialog" ).dialog( "open" );
});
});
</script>
</head>
<body bgcolor="#aaaaaa">
<img src="example.lorg" alt="" style="padding-left:20px" />
<div align="right" style="padding-right:20px">
<div>
<button id="StaffLogin">Staff Login</button>
<button id="select">Select an action</button>
</div>
<ul>
<li>Log Out</li>
<li id="buttonregister">Register</li>
</ul>
</div>
<form style="margin-top: 1em;">
<div id="menu" align="center">
<input type="radio" id="buttonhome" name="radio" checked="checked"><label for="buttonhome">Home</label>
<input type="radio" id="buttonforums" name="radio"><label for="buttonforums">Forums</label>
<input type="radio" id="buttonapply" name="radio"><label for="buttonapply"><a class='fb_iframe' href="http://example.org">Apply</a></label>
<input type="radio" id="buttonabout" name="radio"><label for="buttonabout">About Us</label>
<input type="radio" id="select" name="radio">
</div>
</form>
<br />
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
<strong>Alert:</strong> The Site Is No Where Near Completed, Please go to our Forums
</p>
</div>
</div>
<!-- POP UP -->
<div id="regdialog" title="Register">
<form action="#" method="post">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
Registrations are not working!
</p>
</div>
</div>
<h5>Username:</h5>
<input type="text" name="reg_name">
<h5>Password:</h5>
<input type="password" name="reg_pass">
<h5>Confirm Password:</h5>
<input type="password" name="reg_pass_conf">
<input type="submit">
</form>
</div>
</body>
</html>
index.php:
<!doctype html>
<html lang="us">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="web/style.css">
<link href="css/smoothness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.3.custom.js"></script>
</head>
<body bgcolor="#aaaaaa">
<? include("TopNote.php"); ?>
</body>
</html>
topnote.php
<!doctype html>
<html lang="us">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="web/style.css">
<link href="css/smoothness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
<style>
.ui-menu { position: absolute; width: 100px; }
</style>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.3.custom.js"></script>
<script>
$(function() {
$( "#menu" ).buttonset();
$( "#regdialog" ).dialog();
$( "#buttonregister" ).click(function() {
$( "#regdialog" ).dialog( "open" );
});
});
</script>
</head>
<body bgcolor="#aaaaaa">
<img src="example.lorg" alt="" style="padding-left:20px" />
<div align="right" style="padding-right:20px">
<div>
<button id="StaffLogin">Staff Login</button>
<button id="select">Select an action</button>
</div>
<ul>
<li>Log Out</li>
<li id="buttonregister">Register</li>
</ul>
</div>
<form style="margin-top: 1em;">
<div id="menu" align="center">
<input type="radio" id="buttonhome" name="radio" checked="checked"><label for="buttonhome">Home</label>
<input type="radio" id="buttonforums" name="radio"><label for="buttonforums">Forums</label>
<input type="radio" id="buttonapply" name="radio"><label for="buttonapply"><a class='fb_iframe' href="http://example.org">Apply</a></label>
<input type="radio" id="buttonabout" name="radio"><label for="buttonabout">About Us</label>
<input type="radio" id="select" name="radio">
</div>
</form>
<br />
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
<strong>Alert:</strong> The Site Is No Where Near Completed, Please go to our Forums
</p>
</div>
</div>
<!-- POP UP -->
<div id="regdialog" title="Register">
<form action="#" method="post">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
Registrations are not working!
</p>
</div>
</div>
<h5>Username:</h5>
<input type="text" name="reg_name">
<h5>Password:</h5>
<input type="password" name="reg_pass">
<h5>Confirm Password:</h5>
<input type="password" name="reg_pass_conf">
<input type="submit">
</form>
</div>
</body>
</html>
What is the difference, and how do i solve it?

You can not have a <html> tag inside a <body> tag. Your topnote.php does not need to have a doctype, head and all that stuff. Because index.php defines already html, doctype, head, title and so on.
So your topnote.php should only contain this elements:
<img src="http://destiny-craft.com/img/Logo_Resized.png" alt="" style="padding-left:20px" />
<div align="right" style="padding-right:20px">
<div>
<button id="StaffLogin">Staff Login</button>
<button id="select">Select an action</button>
</div>
<ul>
<li>Log Out</li>
<li id="buttonregister">Register</li>
</ul>
</div>
<form style="margin-top: 1em;">
<div id="menu" align="center">
<input type="radio" id="buttonhome" name="radio" checked="checked"><label for="buttonhome">Home</label>
<input type="radio" id="buttonforums" name="radio"><label for="buttonforums">Forums</label>
<input type="radio" id="buttonapply" name="radio"><label for="buttonapply"><a class='fb_iframe' href="http://destiny-craft.coffeecup.com/forms/ApplyForm/">Apply</a></label>
<input type="radio" id="buttonabout" name="radio"><label for="buttonabout">About Us</label>
<input type="radio" id="select" name="radio">
</div>
</form>
<br />
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
<strong>Alert:</strong> The Site Is No Where Near Completed, Please go to our Forums</p>
</div>
</div>
<!-- POP UP -->
<div id="regdialog" title="Register">
<form action="#" method="post">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
Registrations are not working!</p>
</div>
</div>
<h5>Username:</h5>
<input type="text" name="reg_name">
<h5>Password:</h5>
<input type="password" name="reg_pass">
<h5>Confirm Password:</h5>
<input type="password" name="reg_pass_conf">
<input type="submit">
</form>
</div>
And you can move your <script> tags which are in the <head> tag of your topnote.php to the end of topnote.php. It's valid and better practice to put them right before the closing </body> tag. That ensures that all DOM elements are loaded at this point.

topnote.php should not have doctype, html and head since you already added in the index.php
Avoid the Short Tag which will be XML complaint, use like below
<?php include 'file.php'?>

Related

Form on CSS + output to .txt – problem with calling a PHP function

I have a form on CSS + part that sends data from text fields to the server-located file data.txt
Whenever I click on "submit" button, nothing goes on.
I see this as a clear problem with a calling a PHP script
if(isset($_POST['textdata']))
{
$data=$_POST['textdata'];
$fp = fopen('data.txt', 'a');
fwrite($fp, $data);
fclose($fp);
}
?>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Pure CSS Steps</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<h1>Pure <strong>CSS</strong> Steps</h1>
<p>... a sassy "Step By Step" process.</p>
</header>
<section>
<article>
<form method="post" class="pure-steps" >
<input type="radio" name="steps" class="pure-steps_radio" id="step-0" checked="">
<input type="radio" name="steps" class="pure-steps_radio" id="step-1">
<input type="radio" name="steps" class="pure-steps_radio" id="step-2">
<div class="pure-steps_group">
<ol>
<li class="pure-steps_group-step">
<header>
<h2 class="pure-steps_group-step_legend">Welcome</h2>
<p class="pure-steps_group-step_item">You are about to form the form.</p>
<p class="pure-steps_group-step_item"></p>
</header>
</li>
<li class="pure-steps_group-step">
<fieldset>
<legend class="pure-steps_group-step_legend">Grab a tour</legend>
<p class="pure-steps_group-step_item flexy-item flexy-column reverse">
<input name="textdata" type="text" placeholder="Type your email here" value="" id="input_email" >
<label for="input_email">Email</label>
</p>
<p class="pure-steps_group-step_item flexy-item flexy-column reverse">
<input type="text" placeholder="Type your nick here" value="" id="input_nick">
<label for="input_nick">Name</label>
</p>
<p class="pure-steps_group-step_item flexy-item flexy-column reverse">
<input type="text" placeholder="Type your nick here" value="" id="input_nick">
<label for="input_nick">Phone</label>
</p>
</fieldset>
</li>
<li class="pure-steps_group-step flexy-item">
<div class="pure-steps_preload">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<path d="M31.8,3.6c-0.2-0.5-0.4-0.9-0.9-1.2C30.4,2,29.7,1.8,29,1.9c-0.6,0.1-1.2,0.4-1.6,1l-8.5,11.2l0,0l-7.2,9.5l-7.1-9.4 c-0.5-0.7-1.3-1-2.1-1c-0.5,0-1,0.2-1.4,0.5c-0.5,0.4-0.9,1-1,1.7s0.1,1.2,0.5,1.8l9.1,12.1l0,0c0.1,0.2,0.3,0.3,0.4,0.4 c0.4,0.3,0.9,0.5,1.4,0.5c0.8,0,1.6-0.3,2.1-1L22.1,18l0,0l9.1-12.1C32,5.2,32.1,4.4,31.8,3.6z"></path>
</svg>
</div>
</li>
</ol>
<ol class="pure-steps_group-triggers">
<li class="pure-steps_group-triggers_item">
<label for="step-0">Restart</label>
</li>
<li class="pure-steps_group-triggers_item">
<label for="step-1">Grab a tour</label>
</li>
<input type="submit" name="submit">
<li class="pure-steps_group-triggers_item">
<label type="submit" name="submit" for="step-2">Jump in</label>
</li>
</ol>
</div>
<br>
<label for="step-0">Restart</label>
</form>
</article>
</section>
</body>
</html>
The file is in the place.
What seems to be the problem here?
I see this as a problem with calling a PHP – there is no place to call it.
Any suggestions where is the problem located?
PHP isn't client side and executes once on every request.
You could make the form point to itself which will make the page reload but this time with $_POST data.
<form method="post" class="pure-steps" action="thisPage.php" >

error when connecting database to the form , and give me the below error

I am try to fill the form and I got this error. Please someone tell me why?
I have attached all the code and the images: what I want is when I fill this form, it gets automatically saved in database. And please, if you can provide me how to upload images from the same form to the same database at phpmyadmin.
Error Message:
This is the model :
class Clinic_Model extends CI_Model
{
function insert_into_db()
{
$pfn = $_POST['pfn'];
$pe = $_POST['pe'];
$pmn = $_POST['pmn'];
$pa = $_POST['pa'];
$pw = $_POST['pw'];
$ph = $_POST['ph'];
$pgt = $_POST['pgt'];
$pbp = $_POST['pbp'];
$pec = $_POST['pec'];
$this->db->query("INSERT INTO add_clinic
VALUES($pfn','$pe','$pmn','$pa','$pw','$ph','$pgt','$pbp','$pec')");
}
}
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
This is the controller
class Easyclinic extends CI_Controller {
//----------Constructor----------
public function __construct()
{
parent::__construct();
$this->load->helper('url');
//load Model
$this->load->model('clinic_model');
}
//----------BaseFunctions----------
public function index()
{
$this->load->view('add_patient');
}
public function mydata()
{
$this->load->view('mydata');
}
public function addpatient()
{
$this->load->view('add_patient');
}
//---------Advinced Functions---------
public function insert_into_db()
{
$this->load->model('clinic_model');
$this->clinic_model->insert_into_db();
$this->load->view('success');//loading success view
}
}
this is the view
<!DOCTYPE html>
<html lang="en">
<head>
<title>Add Patient</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="easyclinic" />
<script type="application/x-javascript"> addEventListener("load",
function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<!-- //custom-theme -->
<link href="assests/css/style.css" rel="stylesheet" type="text/css"
media="all" />
<!-- js -->
<script type="text/javascript" src="assests/js/jquery-2.1.4.min.js">
</script>
<!-- //js -->
<link href='//fonts.googleapis.com/css?
family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- banner -->
<div class="center-container">
<div class="main">
<h1 class="w3layouts_head">Add Patient Info</h1>
<h1 class="w3layouts_head">Welcome Dr.Atef</h1>
<div class="w3layouts_main_grid">
<form action="<?php echo base_url();?
>easyclinic/insert_into_db" method="post" class="w3_form_post">
<!-- day/time -->
<div class="agileits_w3layouts_main_grid w3ls_main_grid">
<span class="agileinfo_grid">
<label>Examination Date</label>
<div class="agileits_w3layouts_main_gridl">
<input class="date hasDatepicker" id="datepicker" name="Text"
type="text" value="dd/mm/yyyy" onfocus="this.value = '';" onblur="if
(this.value == '') {this.value = '';}" required="">
</div>
<div class="agileits_w3layouts_main_gridr">
<input type="time" name="Time" placeholder=" " required="">
</div>
<div class="clear"> </div>
</span>
</div>
<!-- name -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Full Name </label>
<input type="text" name="pfn" placeholder=" 4 part name"
required="">
</span>
</div>
<!-- email -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Email </label>
<input type="text" name="pe" placeholder=" Email" required="">
</span>
</div>
<!-- Phone number -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Number </label>
<input type="text" name="pmn" placeholder="Phone Number"
required="">
</span>
</div>
<!-- choose your Gender-->
<div class="content-w3ls">
<div class="form-w3ls">
<div class="content-wthree2">
<div class="grid-w3layouts1">
<div class="w3-agile1">
<label>Gender</label>
<ul>
<li>
<input type="radio" id="a-option" name="pg">
<label for="a-option">Male </label>
<div class="check"></div>
</li>
<li>
<input type="radio" id="b-option" name="pg2">
<label for="b-option">female</label>
<div class="check"><div class="inside"></div></div>
</li>
</ul>
</div>
</div>
<!-- age -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Patient Age </label>
<input type="text" name="pa" placeholder="Patient Age"
required="">
</span>
</div>
<div class="clear"></div>
</div>
</div>
<!-- weight -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Weight</label>
<input type="text" name="pw" placeholder="Weight in
KiloGrams" required="">
</span>
</div>
<!-- Height -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Height</label>
<input type="text" name="ph" placeholder="Height in
CentiMeters" required="">
</span>
</div>
<!-- Glucose -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Glucose Test</label>
<input type="text" name="pgt" placeholder="~100~140"
required="">
</span>
</div>
<!-- Heart pressure -->
<div class="w3_agileits_main_grid w3l_main_grid">
<span class="agileits_grid">
<label>Blood Pressure</label>
<input type="text" name="pbp" placeholder="~120~180"
required="">
</span>
</div>
<!-- Uoload File -->
<div>
<span class="agileits_grid">
<label>Upload sonar image</label>
<form method="post" enctype="multipart/form-data" action="upload">
</br>
Choose a file:
<input type="image" name="usi" />
<input type="submit" />
</form>
</div>
<!-- Uoload File -->
<div>
<span class="agileits_grid">
<label>Upload cbc image</label>
<form method="post" enctype="multipart/form-data" action="upload">
Choose a file:
<input type="image" name="uci" />
<input type="submit" />
</form>
</div>
<!-- day/time -->
<div class="agileits_w3layouts_main_grid w3ls_main_grid">
<span class="agileinfo_grid">
<label>Expectation of Childbirth</label>
<div class="agileits_w3layouts_main_gridl">
<input class="date hasDatepicker" id="datepicker" name="Text"
type="text" value="mm/dd/yyyy" onfocus="this.value = '';"
onblur="if (this.value == '') {this.value = '';}" required="">
</div>
<div class="agileits_w3layouts_main_gridr">
<input type="time" name="pec" placeholder=" " required="">
</div>
<div class="clear"> </div>
</span>
</div>
<!-- submit button -->
<div class="w3_main_grid">
<div class="w3_main_grid_right">
<input type="submit" name="save" value="Submit">
</div>
</div>
</form>
</div>
<!-- Calendar -->
<link rel="stylesheet" href="assests/css/jquery-ui.css" />
<script src="js/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<!-- //Calendar -->
<div class="w3layouts_copy_right">
<div class="container">
<p>© 2018 Patient Registration Form. All rights reserved |
HassanAli</p>
</div>
</div>
</div>
</div>
<!-- //footer -->
</body>
</html>
and this is the image of phpmyadmion:
see phpmyadmin iamge
There is a minor error of a missing ' in your columns of the INSERT statement (VALUES($pfn'), but also there is also a problem of matching the columns up. I would normally list the columns that I am inserting into as well, something like...
$this->db->query("INSERT INTO add_clinic (`Patient Full Name`, *** )
VALUES('$pfn','$pe','$pmn','$pa','$pw','$ph','$pgt','$pbp','$pec')");
(Where *** is just a list of the columns to be inserted into).
There are two recommendations I would like to make - firstly is to change the names of your columns. Having spaces in column names can cause all sorts of problems and is not normally recommended.
Secondly is to look into using prepared statements and bind variables, this will provide all sorts of benefits later, including security and not having problems with certain characters in the text.

Contact php form keeps sending error

I used Tecite for my contact form and am trying to get my form to work but it is coming up with an error message every time that is saying:
"An errr occurred while processing the form."
The staff... and it goes on as a generic error message.
Im not sure what I am missing in my code but would love some help!!
I have posted my code below, one being the contact.html and the other the formmail php code.
php form
---contact.html---
Haus of Originals
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="Haus of Originals Website">
<link href="css/style_contact.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" href="images/h_favicon2.png">
<!-- Script -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<!-- Responsive and mobile friendly stuff -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Haus of Originals
</div>
<div class="button_container" id="toggle">
<span class="top"></span>
<span class="middle"></span>
<span class="bottom"></span>
</div>
<div class="overlay" id="overlay">
<nav class="overlay-menu">
<ul>
<li><a class="one" href="home.html" title="Home">Home</a></li>
<li><a class="one" href="about.html" title="About">About</a></li>
<li><a class="one active" href="contact.html" title="Contact">Contact</a></li>
</ul>
</nav>
</div>
<!-- Header Gif -->
<div class="section banner">
<h4>
We are building brands that we want to be apart of, welcome home. </h4>
</div>
<!-- Header Gif End -->
<div class="section group">
<img src="images/rtt.jpg" alt="walllogo">
</div>
<div class="section group three">
<div class="column span_1_of_2">
<h5>Contact</h5>
<h6> Haus of Originals<br>
28 Intrepid Drive <br>
Bozeman, Montana 59718
<br>
<br>
651.470.6511<br>
406.459.5954
<br> <br>
<a class="three" href="mailto:info#hausoforiginals.com">info#hausoforiginals.com</a>
</h6>
</div>
<div class="column span_2_of_2">
</div>
</div>
<div class="section group four">
<section class="contact-wrap">
<!--Form Action Needs to point to where you have uploaded the formail.php file-->
<form method="post" action="http://www.hausoforiginals.com/formmail/formmail.php" name="ContactForm" class="contact-form">
<!-- Keep this line it's base settings to check and send the form -->
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
<!-- This sets where the email is sent to -->
<input type="hidden" name="recipients" value="info#hausoforiginals.com" />
<!-- This sets the fields to be required. -->
<input type="hidden" name="required" value="EmailAddress:Your email address,FirstName:Your name,Message: Your message" />
<div class="col-sm-6">
<div class="input-block">
<label for="FirstName">First Name</label>
<input type="text" name="FirstName" class="form-control">
</div>
</div>
<div class="col-sm-12">
<div class="input-block">
<label for="EmailAddress">Email</label>
<input type="email" name="EmailAddress" class="form-control">
</div>
</div>
<div class="col-sm-12">
<div class="input-block">
<label for="MessageSubject">Subject</label>
<input type="text" name="MessageSubject" class="form-control">
</div>
</div>
<div class="col-sm-12">
<div class="input-block textarea">
<label for="Message">Spit it Out</label>
<textarea rows="3" name="Message" class="form-control"></textarea>
</div>
</div>
<div class="col-sm-12">
<input type="submit" value="Submit" class="square-button">Send It
</div>
</form>
</section>
</div>
<div class="section group two">
<div class="col spanfooter_1_of_3">
<img class="logoone" src="images/h_logo_hp.jpg" alt="logo">
</div>
<div class="col spanfooter_2_of_3">
<h2>Handles </h2>
<p>Instagram</p>
<p>Twitter </p>
<p>Facebook </p>
<b>back to top</b>
</div>
<div class="col spanfooter_3_of_3">
<h2>Get in Touch</h2>
<p> 651.470.6511 <b>|</b> 406.459.5954 </p><br>
<a class="two" href="mailto:info#hausoforiginals.com"><b>info#hausoforiginals.com</b></a>
<br>
<p>
2017 © All Rights Reserved
</p>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(window).bind('scroll', function() {
checkScrollPos();
});
checkScrollPos();
$('.toTopLink').bind('click', function() {
$('html, body').animate({
scrollTop: 0
}, $(window).scrollTop() / 3);
return false;
});
});
function checkScrollPos() {
if ($(window).scrollTop() > 600) {
$('.toTopLink').fadeIn(1000);
} else {
$('.toTopLink').fadeOut(1000);
}
}
$(document).ready(function() {
//material contact form
$('.contact-form').find('.form-control').each(function() {
var targetItem = $(this).parent();
if ($(this).val()) {
$(targetItem).find('label').css({
'top': '10px',
'fontSize': '14px'
});
}
})
$('.contact-form').find('.form-control').focus(function() {
$(this).parent('.input-block').addClass('focus');
$(this).parent().find('label').animate({
'top': '10px',
'fontSize': '14px'
}, 300);
})
$('.contact-form').find('.form-control').blur(function() {
if ($(this).val().length == 0) {
$(this).parent('.input-block').removeClass('focus');
$(this).parent().find('label').animate({
'top': '25px',
'fontSize': '18px'
}, 300);
}
})
});
$('#toggle').click(function() {
$(this).toggleClass('active');
$('#overlay').toggleClass('open');
});
</script>

Two forms on same page and php script is not working

there are two forms one is registration form and another is sign in form .When am registring with registration form its div element is fetching message from php using isset funtion but when i am doing same thing with sign in it is redirecting page to homepage please help what can i do if am trying to match database if not matched it will fetch value from php and show in the div as in the code
<?php
if (!empty($_POST['finish'])) {
//do something here;
include'php/signup.php';
}
if (!empty($_POST['go'])) {
include'php/signin.php';
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/homepage.css">
<link rel="stylesheet" type="text/css" href="css/login.css">
<link rel="stylesheet" type="text/css" href="css/signup.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/login.js"></script>
<script src="js/signup.js"></script>
<script>
function hideMessage() {
document.getElementById("message").style.display = "none";
};
setTimeout(hideMessage, 5000);
</script>
</head>
<body >
<!--row starts here -->
<div class="row">
<div class="col-1-2">
</div>
<div class="col-1-2">
<div class="container">
<ul class="tabs">
<li class="tab-link current" data-tab="tab-1">Sign Up</li>
<li class="tab-link" data-tab="tab-2">Sign In</li>
</ul>
<div id="tab-1" class="tab-content current">
<div id="message"><?php if(isset($message)) echo $message; ?></div>
<ul id="registration-step">
<li id="account" class="highlight">Account</li>
<li id="password">Password</li>
<li id="general">Nick Name</li>
</ul>
<form name="frmRegistration" id="registration-form" method="post">
<div id="account-field">
<span id="email-error" class="registration-error"></span>
<div><input type="text" name="email" id="email" class="demoInputBox" placeholder="E-mail"/></div>
</div>
<div id="password-field" style="display:none;">
<span id="password-error" class="registration-error"></span>
<div><input type="password" name="password" id="user-password" class="demoInputBox" placeholder="Password"required /></div>
</div>
<div id="general-field" style="display:none;">
<div><input type="text" name="nickname" id="display-name" class="demoInputBox" placeholder="Nick Name"/></div>
</div>
<div>
<input class="btnAction" type="button" name="back" id="back" value="Back" style="display:none;">
<input class="btnAction" type="button" name="next" id="next" value="Next" >
<input class="btnAction" type="submit" name="finish" id="finish" value="Finish" style="display:none;">
</div>
</form>
</div>
<div id="tab-2" class="tab-content">
<div id="signinmsg"><?php if(isset($msg1)) echo $msg1; ?></div>
<form name="signin"method="post">
<input type="text" name="signinemail"class="demoInputBox"placeholder="E-mail">
<br><br>
<input type="text" class="demoInputBox"name="signinpass"placeholder="Password"><br><br>
<input class="btnAction" type="submit" name="go" id="go" value="Go.." >
</form>
</div>
</div>
</div>
<!--this row ends here -->
</body>
</html>
You should be checking if isset and not !empty
<?php
if (isset($_POST['finish'])) {
//do something here;
include'php/signup.php';
}
if (isset($_POST['go'])) {
include'php/signin.php';
}
?>

CKeditor with 2 textareas is no sending all fields changes

I have a form in php that has 2 textareas, this form uses ckeditor in those textareas
When send it, i receive the changes of the first textarea and the data of the second textarea without changes
The html code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link href="../css/estilo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../scripts/prototype.js"></script>
<script type="text/javascript" src="../scripts/dropdown_menu.js"></script>
<script type="text/javascript" src="../scripts/funciones.js"></script>
<script type="text/javascript" src="scripts/funciones.js"></script>
<script type="text/javascript" src="../../ckeditor/ckeditor.js"></script>
</head>
<body >
<div id="container">
<div id="head"></div>
<div id="menucontainer">
<ul id="menu">
<li><a id="Actualizaciones" href="../noticias/noticias.php" title="ACTUALIZACIONES" >ACTUALIZACIONES</a>
</li>
<li><a id="Correo" href="../correos/correos.php" title="CORREOS" >BOLETÍN DE NOTICIAS</a>
</li>
<li><a id="Salir" href="../usuarios/logout.php" title="SALIR" >SALIR</a>
</li>
</ul>
</div>
<div id="submenucontainer">
</div>
<script type="text/javascript">
<!--
var menu = new DropDownMenu($('menu'));
-->
</script>
<div id="menuizq">
<ul class="sec">
<li >Cambiar Contraseña
</li>
<li >Salir
</li>
</ul>
</div>
<div id="administracion">
<div id="titulo">Actualizaciones</div>
<form action="" method="post" name="form1" id="form1" target="_self" enctype="multipart/form-data" >
<div >
<div class="fm-fila " >
<div class="fm-campo" >
Titulo:<br /><input name="txt_titulo" type="text" id="txt_titulo" autocomplete="off" maxlength="60" value="Trazabilidad por Productos" tabindex="1" onKeyPress="return tabular(event,this)" class="input_pre" />
</div>
<div class="fm-campo5" >
Fecha:<br /><input name="txt_fecha" type="text" id="txt_fecha" autocomplete="off" maxlength="10" value="20/08/2013" tabindex="2" onKeyPress="return tabular(event,this)" class="input_pre" />
</div>
<div class="fm-icon" >
<img src="../img/icons/date.png" width="16" height="16" align="top" onclick="displayCalendar($('txt_fecha'),'dd/mm/yyyy',this);" style="cursor:pointer" />
</div>
</div>
<div class="fm-fila " >
<div class="fm-campo2" >
Entradilla:<br />
<textarea name="txt_entradilla" id="txt_entradilla" tabindex="3" class="ckeditor" rows="8"/>prueba 1</textarea>
</div>
</div>
<div class="fm-fila " >
<div class="fm-campo2" >
Detalle:<br />
<textarea name="txt_detalle" id="txt_detalle" tabindex="4" class="ckeditor" rows="8"/>prueba 2</textarea>
</div>
</div>
<div class="fm-fila " >
<div class="fm-campo2" style="text-align:center;">
</div>
</div>
<div class="fm-botonera" >
<input type="button" name="guardar" id="guardar" class="bto-guardar" tabindex="5" value="Guardar" onclick="javascript:validar()" style="margin:6px 0px;"/>
<input type="button" name="cancelar" id="cancelar" class="bto-cancelar" tabindex="6" value="Cancelar" onclick="location.href='noticias.php'" style="margin:6px 0px;"/>
<input type="hidden" name="txt_id" id="txt_id" value="32" />
</div>
</div>
</form>
</div>
</div>
</body>
</html>
The php code is:
<?php
echo $_POST['txt_entradilla'];
echo $_POST['txt_detalle'];
?>
If I take out the first textarea the second sends the changes and if I place first textarea "B" and then the textarea "A", the textarea "A" don’t have the changes.
I'm using CKeditor 4.2.
i upload my files to mediafire, here is the link: http://www.mediafire.com/?x73h2sjq8ku63ih

Categories