Hi,
I am having trouble with this page, it is completely blank. I have turned on error reporting but nothing happens, does anyone know what has happened to it? It has worked previously so maybe I have changed something but not sure what.
<?php
session_start();
ob_start();
if(!isset($_SESSION['authenticated']))
{
header ("Location: http://www.example.com") ;
}
else
{
?>
<html>
<head>
<? include ("/home/example.com"); ?>
</head>
<body>
<div id="main">
<?php include ("/home/example.com"); ?>
<div id="content">
<div id="info">
<?php
$link = mysql_connect("","","");
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db();
$pagename=ereg_replace("[^A-Za-z0-9]", "", $bandname);
$bandname = mysql_real_escape_string($_POST['bandname']);
$email = mysql_real_escape_string($_POST['email']);
$myspace = mysql_real_escape_string($_POST['myspace']);
$twitter = mysql_real_escape_string($_POST['twitter']);
$facebook = mysql_real_escape_string($_POST['facebook']);
$website = mysql_real_escape_string($_POST['website']);
$firstname = mysql_real_escape_string($_POST['firstname']);
$surname = mysql_real_escape_string($_POST['surname']);
$location = mysql_real_escape_string($_POST['location']);
$about = mysql_real_escape_string($_POST['about']);
$genre = mysql_real_escape_string($_POST['genre']);
$username = mysql_real_escape_string($username);
$pagename = mysql_real_escape_string($pagename);
$query = ("SELECT * FROM bands WHERE BandName = '$bandname'");
$result = mysql_query($query);
$num = mysql_num_rows($result);
if ($num == 0) {
$sql="INSERT INTO bands (BandName, Email, Myspace, Twitter, Facebook, Website, Firstname, Surname, Location, About, Genre, Username, PageName)
VALUES
('$bandname','$email','$myspace','$twitter','$facebook','$website','$firstname','$surname','$location','$about','$genre','$username','$pagename')";
if (!mysql_query($sql,$link))
{
die('Error: ' . mysql_error());
}
header ("Location: http://www.example.com") ;
mysql_close($link);
}
else {
echo 'Sorry, there is already a band listed using that name, please try again with a different name or email help@unsignedgigs.co.uk.’;
include '/home/example.com';
}
}
?>
</div>
<div id="ad">
<?php include ("/home/example.com"); ?>
</div>
<div id="ad2">
<?php include ("/home/example.com"); ?>
</div>
<div id="footer">
<?php include ("/home/example.com"); ?>
</div>
</div>
</div>
</body>
</html>
Thanks for any help - I realise it isn't great code as well, but I am learning.