well i don't know what to say other than I have an error in this script and i can't find it, if anyone could point me in the right direction, i'd GREATLY appreciate it.
here's is the entire page in case it's somewhere in the top, honestly i'm so frustrated with it i could punch a bunny, or light my computer on fire, thanks in advance
<?php ob_start();?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-*******-1']);
_gaq.push(['_setDomainName', '.when-money.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<?php // Connects to Database
mysql_connect("localhost", "whenmone_****", "*******") or die(mysql_error());
mysql_select_db("whenmone_****") or die(mysql_error());
//This code runs if the form has been submitted
if (isset($_POST['submit'])) {
//This makes sure they did not leave any fields blank
if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] | !$_POST['artistname'] | !$_POST['payment_email_address'] ) {
die('You did not complete all of the required fields');
}
// checks if the username is in use
if (!get_magic_quotes_gpc()) {
$_POST['username'] = addslashes($_POST['username']);
}
$usercheck = $_POST['username'];
$check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")
or die(mysql_error());
$check2 = mysql_num_rows($check);
//if the name exists it gives an error
if ($check2 != 0) {
die('Sorry, the username '.$_POST['username'].' is already in use.');
}
// this makes sure both passwords entered match
if ($_POST['pass'] != $_POST['pass2']) {
die('Your passwords did not match. ');
}
// here we encrypt the password and add slashes if needed
$_POST['pass'] = md5($_POST['pass']);
if (!get_magic_quotes_gpc()) {
$_POST['pass'] = addslashes($_POST['pass']);
$_POST['username'] = addslashes($_POST['username']);
}
// now we insert it into the database
$insert = "INSERT INTO users (username, password, artistname, summary, email_address)
VALUES ('".$_POST['username']."', '".$_POST['pass']."','".$_POST['artistname']."','".$_POST['summary']."','".$_POST['influences']."','".$_POST['whyimhere']."','".$_POST['email_address']."')";
$add_member = mysql_query($insert);
?>
<?php }
else { ?>
<link href="styling/when-money.css" rel="stylesheet" type="text/css">
<div class="container">
<div class="header">
<p><a href="http//:www.when-money.com"><img src="images/yellowbanner2raised.jpg" alt=" When Money .com" width="1024" height="150" align="absmiddle" /></a></a><a href="#"><a href="#"></a><a href="#"></a></a></br></br>
<span class="fonter">Username and password are required for all users, if you plan to sell your art be sure to fill out as much artist info as possible, otherwise if you just plan to download and use the art you can leave these fields blank.</span></p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table border="0">
<tr>
<td align="center">Username:</td>
<td>
<input type="text" name="username" maxlength="60">
</td></tr>
<tr><td align="center">Password:</td><td>
<input type="password" name="pass" maxlength="10">
</td></tr>
<tr><td align="center">Confirm Password:</td><td>
<input type="password" name="pass2" maxlength="10">
</td></tr>
<tr>
<td align="center">Your name as you would like it to apear on you profile</td>
<td>
<input type="text" name="artistname" maxlength="60">
</td></tr>
<tr>
<td align="center">Artist Summary(give a brief description about yourself and your art)</td>
<td><textarea name="summary"></textarea>
</td></tr>
<tr>
<td align="center">Email address you would like to appear on your artist profile for contact</td>
<td><input name="email_address" type="text" value="">
</td>
</tr>
<td align="center">Influences (artists, paintings, cartoons or anything else that has inspired you) </td>
<td><textarea name="influences"></textarea>
</td>
</tr>
<td align="center">Why are you here (if you were to sell, why you joined the site)</td>
<td><textarea name="whyimhere"></textarea>
</td>
<tr align="center"><th colspan=2><input type="submit" name="submit"
value="First Sign in"></th></tr> </table>
</form>
<?php
echo @$REMOTE_ADDR;
?>
<?php
//name of the template file
$tpl_file = "artistprofiletmp2.html";
//path to the directory where the "template.html" file is
$tpl_path = "/home1/whenmone/public_html/members/templates/";
//path to the directory where the auto-generated members pages go
$members_path = "/home1/whenmone/public_html/members/";
$data = array($_POST['username']."', '".$_POST['pass']."','".$_POST['artistname']."','".$_POST['summary']."','".$_POST['influences']."','".$_POST['whyimhere']."','".$_POST['email_address']."'");
//store all of the template placeholders into an array.
$placeholders = array("{artistname}", "{summary}", "{influences}", "{whyimhere}", "{email_address}");
//Get the template.html as a string:
$tpl = file_get_contents($tpl_path.$tpl_file);
//replace the template placeholders with their correspond values.
$new_member_file = str_replace($placeholders, $data, $tpl);
//create a new html file.
$html_file_name = $data['username'].".html";
//write this file to the members directory:
$fp = fopen($members_path.$html_file_name, "w");
fwrite($fp, $new_member_file);
fclose($fp);
?>
<?php ob_end_flush();?>