if isset $_POST output fail - php

I'm trying to create a banning system for a chat that I made and it has a separate "console" only seen by admins. Im using Mac OS 10.11.4, I am the owner and am using Mamp with php version 5.6.10
Ban.php
<?php
$ban = $_POST['ban'];
$mybfile = fopen("banned.txt", 'a');
$txtb = ($ban." , ");
//Makes sure ip banned it not an admins
if (isset($_POST['ban'])) {
//example ip addresses
if ($ban === '1.1.1.1' || 192.168.1.132) {
echo 'Can\'t ban an Admin';
} else {
echo 'IP banned';
fwrite($mybfile, $txtb);
fclose($mybfile);
}
}
?>
<style>
.ban {
background-color: black;
width:30em;
height:5em;
color: #7ACC52;
}
.buttonBAN {
border:1px solid black;
width: 85px;
height: 55px;
background-color: white;
color: black;
position: absolute;
}
</style>
<body>
<form method="POST">
BanCMD<br />
<input type="text" name="ban" class="ban">
<input type="submit" value="Enter" class="buttonBAN">
</form>
</body>
Chat.php:
<?php
require "blocked.php";
require "connect.inc.php";
require "core.inc.php";
require "commands.php";
$sent = $_POST['chat'];
$myfile = fopen("chat.txt", 'a') or die("Unable to open file!");
$txt = ($sent."\n");
$first = getuserfield('username');
$active = ($first.":".$ip_addr);
$activef = fopen("ip-user.txt", 'a');
$myFile = "domains/domain_list.txt";
if (loggedin()) {
echo 'Welcome, '.$first,'<br />';
if ($first != 'SnR' || 'Koi') {
fwrite($activef, $active."\n"."=");
}
} else if (!loggedin()) {
die('Not logged in');
}
if (isset($_POST['chat'])) {
if (!empty($sent)) {
fwrite($myfile, $first.': '.$txt.'=');
fclose($myfile);
} else if (empty($sent)) {
echo 'Cant send an empty message','<br />';
}
}
$file = "chat.txt";
$linecount = 0;
$handle = fopen($file, "r");
while(!feof($handle)){
$line = fgets($handle);
$linecount++;
}
fclose($handle);
if ($linecount > 49) {
unlink($file);
} else {
echo 'Line count: '.$linecount,'<br />';
}
echo 'Chat will reset at 50 lines','<br />';
echo 'Your IP:';
echo $ip_addr,'<br />';
?>
<html>
<head>
</head>
<body>
<!-- <a href='active.txt'>Online users</a><br /> -->
<iframe id='reload' src='refresh.php'>
<fieldset class="field">
<div id="list"><p><?php
$filename = 'chat.txt';
$handle = fopen($filename, 'r');
$detain = fread($handle, filesize($filename));
$chat_array = explode('=', $detain);
foreach($chat_array as $chat) {
echo $chat.'<br />';
}
?></p></div>
</fieldset>
</iframe>
<form action="chat.php" method="POST">
<input type="text" name="chat" class="textbox">
<input type="submit" value="Send" class="button">
</form>
</body>
</html>
<?php
if ($first == 'SnR' && 'Koi') {
include 'AdminCMD.php';
include 'ban.php';
?>
<iframe id='reload' src='refresh2.php' class="field2">
<fieldset class="field">
</fieldset>
</iframe>
<?php
}
?>
The problem is that everything is fine until you give an input, no matter what you put into the box the output is always "Can't ban an Admin" meaning that it doesn't write to the given file
Thank you for any help.

Your code contains an error, preventing the file from being written. The first line of PHP code,$ban = $_POST['ban'];, could fail if no post data was sent. You need to first check if the $_POST['ban'] was set. A fixed version of your code can be found below.
<?php
//Makes sure ip banned it not an admins
if (isset($_POST['ban'])) {
$ban = $_POST['ban'];
$mybfile = fopen("banned.txt", 'a');
$txtb = ($ban." , ");
if ($ban === '1.1.1.1') {
echo 'Can\'t ban an Admin';
} else {
echo 'IP banned';
fwrite($mybfile, $txtb);
fclose($mybfile);
}
}
?>
<style>
.ban {
background-color: black;
width:30em;
height:5em;
color: #7ACC52;
}
.buttonBAN {
border:1px solid black;
width: 85px;
height: 55px;
background-color: white;
color: black;
position: absolute;
}
</style>
<body>
<form method="POST">
BanCMD<br />
<input type="text" name="ban" class="ban">
<input type="submit" value="Enter" class="buttonBAN">
</form>
</body>

When i ran your code it returns undefined index ban, you can try this and make sure what is not working for you.
<?php
$ban = isset($_POST['ban']) ? $_POST['ban'] : null;
$mybfile = fopen("banned.txt", 'a');
$txtb = ($ban." , ");
//Makes sure ip banned it not an admins
if(isset($ban)){
if ($ban === '1.1.1.1') {
echo 'Can\'t ban an Admin';
} else {
echo 'IP banned';
fwrite($mybfile, $txtb);
fclose($mybfile);
}
}
?>
<style>
.ban {
background-color: black;
width:30em;
height:5em;
color: #7ACC52;
}
.buttonBAN {
border:1px solid black;
width: 85px;
height: 55px;
background-color: white;
color: black;
position: absolute;
}
</style>
<body>
<form method="POST">
BanCMD<br />
<input type="text" name="ban" class="ban">
<input type="submit" value="Enter" class="buttonBAN">
</form>
</body>

Related

How do I access the php file in a local server from an another computer

I hosted my website on a localserver using xampp. So I was trying to access the website from another computer which was on the same network. I could access the index.html file that had to enter login details like the username and password but when I hit submit, I don't get to php page which should show the details of the user by retrieving it from the database. How am I suppose to access the php file too?
I was able to access the phpmyadmin page too from the other computer but can't access the php page as it says "the site can't be reached. localhost refused to connect"
My html code
<!DOCTYPE html>
<html>
<head>
<title>Login to Student's Database</title>
<style>
label {
font: normal 12px courier !important;
}
.sbm{
padding: 10px;
margin-left: 50px;
}
.whole{
background-image: url("images/bg-01.jpg");
background-attachment: fixed;
width: 1340px;
height: 640px;
background-repeat: repeat-x;
}
p {
font: bold 20px sans-serif;
padding: 20px;
}
</style>
</head>
<body>
<div class="whole">
<div align="center">
<form name="hun" method="post" action="http://localhost/exam/retrieve.php">
<p>Welcome To Student's Record</p>
<label for="user" > Username :</label>
<input type="text" name="username"><br><br>
<label for="pass"> Password :</label>
<input type="password" name="pass"> <br><br>
<div class="sbm"><input type="submit" name="submit"></div>
</form>
<div align="center">
</div>
</body>
</html>
My php code
<?php
$puser = $_POST['username'];
$ppass = $_POST['pass'];
$con = mysqli_connect('localhost','root','','student');
if(!$con)
{
die("Could not connect".mysql_error());
}
$pss=$ppass;
$usr=$puser;
$flag=0;
$que = "select * from rec";
$q = mysqli_query($con, $que);
if(!$q)
{
echo "Could not retrieve!";
}
else
{
while($ret = mysqli_fetch_array($q, MYSQLI_NUM))
{
if(($pss==$ret[1])&&($usr==$ret[0]))
{ $flag=1;
echo "Welcome to University<br>";
echo "Name = ";
echo $ret[2] . "<br>";
echo "Roll = ";
echo $ret[3]."<br>";
echo "Physics = ";
echo $ret[4]."<br>";
echo "Chemistry = ";
echo $ret[5]."<br>";
echo "Maths = ";
echo $ret[6];
}
}
}
if(!$flag)
{
echo "Wrong username or password";
}
?>

Removing an option from dropbox after selected

I have a state guessing guess I wrote. I'm trying to remove a capital from the dropbox menu after it has been guessed. Any clues on how to go about doing that?
I have a comment on line 44 which is code that I believe may work but I havent been able to get working.
Thanks for reading and thanks in advance!
Heres my code:
<?php
require_once "include/session.php";
if (!isset($session->valid)) {
header("location: login.php");
exit();
}
require_once "include/city_info.php";
/* DO NOT MODIFY THE ABOVE LINES !!!!! */
$states = array_keys($state_capitals);
$capitals = array_values($state_capitals);
$cities = array_merge($capitals, $other_cities);
sort($cities);
$params = (object) $_REQUEST;
if (isset ($params->guess) ) {
$state = $session->statename;
$capital = $params->city;
$city = $params->city;
$session->guess ++ ;
//if they guess correctly
if ($capital == $state_capitals[$session->statename]){
$response = "You've Guessed Correct After $session->guess Guesses";
}
//if they guess incorrectly
else {
$response = " You've Guessed Wrong $session->guess Times";}
}
else {
$index = rand( 0, count($states)- 1 );
$state = $states[ $index ];
$city = $state_capitals[ $state ];
$session->statename = $state;
$guess = (0);
$session->guess = (0);
$response = "Try To Get Less Than 3 Guesses";
// create initial selections
//$session->selections = array();
// foreach($city as $value) {
// $session->selections[$value] = 1;
//}
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Cache-Control"
content="no-cache, max-age=0, no-store, must-revalidate" />
<title>State Capital Guessing Game</title>
<style type="text/css">
body {
background-color:#ffff4d;
}
div {
position:center;
width: 350px;
padding: 10px;
border: 3px solid black;
border-radius: 10px;
color: black;
background-color:#3399ff;
}
}
h1{
padding:5px;
}
h2 {
text-align: center;
font-size:20px;
}
h3 {
text-align:center;
}
h4 {
text-align:center;
}
h5 {
position: absolute;
top:0px;
right:0px;
}
#logout {
position: absolute;
top: 0px;
right: 0px;
}
</style>
</head>
<body>
<a id="logout" href="logout.php">Log out</a>
<h1>
State Capital Guess Game
<form action="program.php" method="get">
<button type="submit">Reset</button>
</h1>
</form>
<div>
<form action="program.php" method="post">
<input type="hidden" name="answer" value="<?php echo $state?>" />
<h2>
Guess the capital of: <?php echo "$session->state" ?>
</h2>
<h3>
<select name="city">
<?php
$options = "";
foreach ($cities as $value){
$options .= '<option value="' . $value . '"';
if ($value == $params->city)
$options .= ' selected';
$options .= '>' . $value . '</option>';
}
echo $options;
?>
</select>
<input type="submit" name="guess" value="Guess" />
</form>
</h3>
<h4><?php echo $response ?></h4>
</div>
<h5><?php echo "The Correct Answer Is: $state_capitals[$state]" ?><h5>
</body>
</html>​

How to add delete in php script in my photo gallery

I made a Photo gallery by php.
I am able to make upload image and show the image list. But i want to add a delete button where users can delete there unwanted image. But i was failed to add this button work.
Someone please help to fix it?
Here is my code on GitHub: https://github.com/sagar290/photo_gallerey/blob/6cad3743e735ea109723de7e14d5477bff1e964b/gallery.php
<?php
if (isset($_FILES["file"]["name"])) {
$name = $_FILES['file']['name'];
//$size = $_FILES['file']['size'];
//$extention = $type;
$type = strtolower($_FILES['file']['type']);
$tmp_name = $_FILES['file']['tmp_name'];
if (isset($name)) {
if (!empty($name)) {
if (($type=='image/jpg')||($type=='image/jpeg')||($type=='image/gif')) {
$location = 'photos/';
if(move_uploaded_file($tmp_name, 'photos/'.$name)) {
echo $name.' is uploaded';
}
}else {
echo 'file must be jpg or jpeg ';
}
}else {
echo 'please choose a file';
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Photo gallery</title>
<style type="text/css">
ul {
list-style-type: none;
}
li {
float: left;
padding: 10px;
margin: 10px;
font: bold 10px Verdana, sans-serif;
}
img {
display: block;
border: 1px solid #333300;
margin-bottom: 5px;
}
</style>
</head>
<body>
<h2>Photo gallery</h2>
<form action="gallery.php" method="POST" enctype="multipart/form-data">
UPLOAD:
<input type="file" name="file"><br><br>
<input type="submit" value="submit">
</form>
<ul>
<form action="gallery.php" method="POST">
<?php
//define location of photo image
$photosDir = './photos';
//define which file extention are images
$photosExt = array('gif','jpg','jpeg','tif','tiff','bmp','png');
//initialize array to hold filenames of images found
$photoList = array();
//read directory contents
//build photo list
if (file_exists($photosDir)) {
$dp = opendir($photosDir) or die('Error: cannot open file');
while ($file = readdir($dp)) {
if ($file != '.' && $file != '..') {
$fileData = pathinfo($file);
if (in_array($fileData['extension'], $photosExt)) {
$photoList[] = "$photosDir/$file"; // file includes as an array
}
}
}
closedir($dp);
}else {
die('ERROR: directory dosent exists');
}
//itarate over photo list
//display each image and file name
if (count($photoList)>0) {
for ($x=0; $x <count($photoList) ; $x++) {
?>
<li>
<input type="submit" name="delete" value="Delete">
<img src="<?php echo $photoList[$x]; ?>" height="150" width="200"/>
<?php echo basename($photoList[$x]); ?><br>
<?php echo round(filesize($photoList[$x])/1024) . 'KB'; ?>
</li>
<?php
}
} else {
die('ERROR: No image found');
}
?>
</form>
</ul>
</body>
</html>
hello just change your submit input to:
<input type="submit" name="delete" value="<?php echo $photoList[$x] ?>">
and then check for that value:
<?php if(isset($_POST['delete']) && !empty($_POST['delete'])){
//find the file
$file = 'photos/'.$_POST['delete'];
if(is_file($file)){
unlink($file);
}else{
echo $_POST['delete']." has not been found!";
}
}?>

excel data into database using php

this is my sample excelsheet values
State 1972-1973 1973-1974 1974-1975 1975-1976 1976-1977 1977-1978 1978-1979 1979-1980 1980-1981 1981-1982
Alabama $733,750 $1,066,300 $1,136,244 $1,343,670 $1,476,307 $1,642,927 $1,507,315 $1,849,825 $2,402,873 $2,079,000
Alaska $1,019,000 $1,100,000 $1,180,500 $1,172,300 $1,415,300 $1,411,700 $1,666,500 $2,026,400 $3,409,800 $7,200,000
Arkansas $890,496 $1,173,304 $1,193,362 $1,735,266 $1,824,536 $1,929,071 $2,090,590 $2,173,595 $2,042,632 $2,203,864
through php coding i need to store in db.how to store it.
just try this
<title>Upload page</title>
<style type="text/css">
body {
background: #E3F4FC;
font: normal 14px/30px Helvetica, Arial, sans-serif;
color: #2b2b2b;
}
a {
color:#898989;
font-size:14px;
font-weight:bold;
text-decoration:none;
}
a:hover {
color:#CC0033;
}
h1 {
font: bold 14px Helvetica, Arial, sans-serif;
color: #CC0033;
}
h2 {
font: bold 14px Helvetica, Arial, sans-serif;
color: #898989;
}
#container {
background: #CCC;
margin: 100px auto;
width: 945px;
}
#form {padding: 20px 150px;}
#form input {margin-bottom: 20px;}
</style>
</head>
<body>
<div id="container">
<div id="form">
<?php
include "e2.php"; //Connect to Database
$deleterecords = "TRUNCATE TABLE books"; //empty the table of its current records
mysql_query($deleterecords);
//Upload File
if (isset($_POST['submit'])) {
if (is_uploaded_file($_FILES['filename']['tmp_name'])) {
echo "<h1>" . "File ". $_FILES['filename']['name'] ." uploaded successfully." . "</h1>";
echo "<h2>Displaying contents:</h2>";
readfile($_FILES['filename']['tmp_name']);
}
//Import uploaded file to Database
$handle = fopen($_FILES['filename']['tmp_name'], "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$import="INSERT INTO books (BookID,Title,Author,PublisherName,CopyrightYear) VALUES('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
//view upload form
}else {
print "Upload new csv by browsing to file and clicking on Upload<br />\n";
print "<form enctype='multipart/form-data' action='index.php' method='post'>";
print "File name to import:<br />\n";
print "<input size='50' type='file' name='filename'><br />\n";
print "<input type='submit' name='submit' value='Upload'></form>";
}
?>
</div>
</div>
</body>
</html>
this is e2.php
$db = mysql_connect("localhost","root","") or die("Could not connect.");
if(!$db)
die("no db");
if(!mysql_select_db("books",$db))
die("No database selected.");
?>
Try this
simplex excel library and script you can create your own excel import to mysql.
if (isset($_FILES['file'])) {
require_once "simplexlsx.class.php";
$xlsx = new SimpleXLSX( $_FILES['file']['tmp_name'] );
echo '<h1>Parsing Result</h1>';
echo '<table border="1" cellpadding="3" style="border-collapse: collapse">';
list($cols,) = $xlsx->dimension();
foreach( $xlsx->rows() as $k => $r) {
// if ($k == 0) continue; // skip first row
echo '<tr>';
for( $i = 0; $i < $cols; $i++)
echo '<td>'.( (isset($r[$i])) ? $r[$i] : ' ' ).'</td>';
echo '</tr>';
}
echo '</table>';
}
?>
<h1>Upload</h1>
<form method="post" enctype="multipart/form-data">
*.XLSX <input type="file" name="file" /> <input type="submit" value="Parse" />
</form>
the following worked for me if the source is a csv file:
$filename = "/path/to/your/csvfile.csv";
$handle = fopen ($filename, "r");
$buffer = "";
while (!feof($handle)) {
$buffer .= fgets($handle, 16384);
}
$array = parse_csv_php($buffer);
// do what you want with your array...
function parse_csv_php(&$data,$delim=';',$enclosure='"'){
$enclosed=false;
$fldcount=0;
$linecount=0;
$fldval='';
for($i=0;$i<strlen($data);$i++) {
$chr=$data{$i};
switch($chr) {
case $enclosure:
if($enclosed&&$data{$i+1}==$enclosure) {
$fldval.=$chr;
++$i; //skip next char
} else { $enclosed=!$enclosed; }
break;
case $delim:
if(!$enclosed) {
$ret_array[$linecount][$fldcount++]=$fldval;
$fldval='';
} else { $fldval.=$chr; }
break;
case "\r":
if(!$enclosed&&$data{$i+1}=="\n")
continue;
case "\n":
if(!$enclosed) {
$ret_array[$linecount][$fldcount]=$fldval;
$linecount++;
$fldcount=0;
$fldval='';
} else { $fldval.=$chr; }
break;
default:
$fldval.=$chr;
}
}
if($fldval) {
$ret_array[$linecount][$fldcount]=$fldval;
}
return $ret_array;
}

Why can't I insert my php login form into my site template?

what is going on?
I recently installed and updated a site template , and designed it.
My friend had some site which he got on it a php login form, for users to log in.
I asked him for the code and he gave me it, and ofc I just copied the code and pasted it between my site template code.
I know u confused, so here's the deal:
This is a basic page on my site:
<?php
include('config.php');
if(MODULE == 'none')
{
include(LOVE_ROOT . '/system/love_head.php');
$content = '<h2> Welcome to OUR SITE </h2>
<br />
Hey this is a test
<br />
Hey this is a test
<br />
Hey this is a test
<br /> <br />
Hey this is a test
<br />
Hey this is a test
<br />
Hey this is a test
<br />
Hey this is a test
<br />
Hey this is a test
<br /> <br />
Welcome
<br />
Welcome to our site
<br />
Hey this is a test
<br /> <br /> <br />
';
include(LOVE_ROOT . '/system/love_foot.php');
}
else
{
header('Location: modules/' . MODULE);
}
?>
and here is the login form php code:
<?php
ob_start();
?>
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
<style>
a:link,a:visited,a:active
{
background: transparent;
color: #000000;
text-decoration: none;
}
a:hover
{
background: transparent;
color: #00dfff;
}
td {
border: 1px solid gray;
padding: 5px;
text-align: center;
}
</style>
</head>
<center>
<?php
include('mysql.php');
$fname = $_POST['fname'];
$password = $_POST['pass'];
$pass1 = md5($password);
$pass = sha1($pass1);
$select = mysql_query("SELECT * FROM `users` WHERE fname='$fname'");
$cu = mysql_fetch_array($select);
if (!empty($_COOKIE['adv_U']) AND !empty($_COOKIE['adv_P']))
{
echo "אתה כבר מחובר לתחרות.";
}
else
{
if (!empty($username) || !empty($password))
{
if (empty($cu))
{
?>
<font color="darkred"><b>
שגיאה - השם הפרטי שהכנסת לא קיים במערכת
</b></font>
<br><br>
<input type="button" value="חזור אחורה" onclick="window.location.href='javascript:window.history.back(-1)';">
<?php
}
else if ($pass == $cu['password'])
{
if ($cu['ban'] == 1)
{
echo "<font color='red'><b>אתה מורחק מהתחרות עקב עבירה על החוקים!</b></font><br>אתה מוחזר לדף הבית של המערכת...";
echo "<meta http-equiv='refresh' content='3; url=index.php'>";
}
else
{
setcookie('adv_U',$fname);
setcookie('adv_P',$pass);
header( 'Location: index.php' );
}
}
else
{
?>
<font color="darkred"><b>
הסיסמא שהכנסת שגויה
</b></font>
<br><br>
<input type="button" value="חזור אחורה" onclick="window.location.href='javascript:window.history.back(-1)';">
<?php
}
}
else
{
?>
<form method="post" action="login.php">
<table>
<tr><td>שם פרטי</td><td><input type="text" name="fname"></td></tr>
<tr><td>סיסמא</td><td><input type="password" name="pass"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="התחברות"></td></tr>
<tr><td colspan="2" align="center"><font size="2">(עוד לא נרשמת?)</font></td></tr>
</table>
</form>
<?php
}
}
?>
</div>
</td>
</tr>
</table>
</body>
</html>
<?php
ob_end_flush();
?>
I tried to copy the php code between the headers of my page, to something like that:
<?php
include('config.php');
if(MODULE == 'none')
{
include(LOVE_ROOT . '/system/love_head.php');
$content = '<h2> Welcome to OUR SITE </h2>
<br />
<?php
ob_start();
?>
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
<style>
a:link,a:visited,a:active
{
background: transparent;
color: #000000;
text-decoration: none;
}
a:hover
{
background: transparent;
color: #00dfff;
}
td {
border: 1px solid gray;
padding: 5px;
text-align: center;
}
</style>
</head>
<center>
<?php
include('mysql.php');
$fname = $_POST['fname'];
$password = $_POST['pass'];
$pass1 = md5($password);
$pass = sha1($pass1);
$select = mysql_query("SELECT * FROM `users` WHERE fname='$fname'");
$cu = mysql_fetch_array($select);
if (!empty($_COOKIE['adv_U']) AND !empty($_COOKIE['adv_P']))
{
echo "אתה כבר מחובר לתחרות.";
}
else
{
if (!empty($username) || !empty($password))
{
if (empty($cu))
{
?>
<font color="darkred"><b>
שגיאה - השם הפרטי שהכנסת לא קיים במערכת
</b></font>
<br><br>
<input type="button" value="חזור אחורה" onclick="window.location.href='javascript:window.history.back(-1)';">
<?php
}
else if ($pass == $cu['password'])
{
if ($cu['ban'] == 1)
{
echo "<font color='red'><b>אתה מורחק מהתחרות עקב עבירה על החוקים!</b></font><br>אתה מוחזר לדף הבית של המערכת...";
echo "<meta http-equiv='refresh' content='3; url=index.php'>";
}
else
{
setcookie('adv_U',$fname);
setcookie('adv_P',$pass);
header( 'Location: index.php' );
}
}
else
{
?>
<font color="darkred"><b>
הסיסמא שהכנסת שגויה
</b></font>
<br><br>
<input type="button" value="חזור אחורה" onclick="window.location.href='javascript:window.history.back(-1)';">
<?php
}
}
else
{
?>
<form method="post" action="login.php">
<table>
<tr><td>שם פרטי</td><td><input type="text" name="fname"></td></tr>
<tr><td>סיסמא</td><td><input type="password" name="pass"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="התחברות"></td></tr>
<tr><td colspan="2" align="center"><font size="2">(עוד לא נרשמת?)</font></td></tr>
</table>
</form>
<?php
}
}
?>
</div>
</td>
</tr>
</table>
</body>
</html>
<?php
ob_end_flush();
?>
<br /> <br /> <br />
';
include(LOVE_ROOT . '/system/love_foot.php');
}
else
{
header('Location: modules/' . MODULE);
}
?>
Of course I handled all the problems, deleted php tags where it's not neccessery, closed qoutes and etc..
but still.. it just won't work.
Sorry for my English,
Sorry for my lame knowledge,
please try and help a bummed guy who stuck with this problem already a week..
Thanks alot!
ALSO(!) I tried to fix it with NetBeans... but didn't manage.. lol I dont evenk now how this software works..
If I take the php code as it self, the original one, it works. If I take the original index file without anything else, it works.
When I add the code to the site template with the "love_foot" "love_head" and etc.. around the php login code, it tells me "unexpected T String".
So what is the problem here?
Thanks alot , I am so LOST right now!
You're missing the semicolon on Line 8. That's causing the rest of the PHP lines to be ignored.
Change it to:
$content = '<h2> Welcome to OUR SITE </h2><br />';
And around line ~127, you forgot to open the <? tag.
I believe that should fix the errors.
However you should use an IDE with syntax highlighting. That'll help you debug code faster.

Categories