Independent
23-06-2008, 08:57 PM
What's wrong with this code?
It removes the entries from the database, I moved to hostgator a day ago, and I get all the fields removed, other than smallbio, anyone help?
It's already connected to the database, I grabbed this code from a file which contains other "actions".
Also, it used to work before I moved server.
Hostgator use PHP 5.. I did a phpinfo(); if you need.
http://images.nivade.com/phpinfo.php (Dont ask why in image folder)
My previous server was running php 4.
if($_GET ['f'] == "profile") {
if($_POST[profile]) {
$newage = silence($_POST['age']);
$newtitle = silence($_POST['title']);
$newavata = silence(bbcode($_POST['avatar']));
$newsmallbio = silence(bbcode($_POST['smallbio']));
$newsex = silence(bbcode($_POST['sexuality']));
$newrela = silence(bbcode($_POST['relation']));
$newskin = silence(bbcode($_POST['skin']));
$cleanedmsn = silence(bbcode($_POST['msn']));
$newgender = silence(bbcode($_POST['gender']));
$media = silence(bbcode($_POST['muzic']));
$query1 = mysql_query("UPDATE `profile` SET age='$newage' WHERE name='$nivusr'") or die("Age error<br>");
$query2 = mysql_query("UPDATE `profile` SET title='$newtitle' WHERE name='$nivusr'") or die("Title error<br>");
$query3 = mysql_query("UPDATE `profile` SET myimg='$newavata' WHERE name='$nivusr'") or die("Avatar error<br>");
$query4 = mysql_query("UPDATE `profile` SET me='$postbout' WHERE name='$nivusr'") or die("Little Bio error<br>");
$query5 = mysql_query("UPDATE `profile` SET sexuality='$newsex' WHERE name='$nivusr'") or die("Sexuality error<br>");
$query6 = mysql_query("UPDATE `profile` SET relatstat='$newrela' WHERE name='$nivusr'") or die("Relationship error<br>");
$query8 = mysql_query("UPDATE `profile` SET skin='$newskin' WHERE name='$nivusr'") or die("Skin error<br>");
$query9 = mysql_query("UPDATE `profile` SET gender='$newgender' WHERE name='$nivusr'") or die("Gender error<br>");
$query10 = mysql_query("UPDATE `profile` SET msn='$cleanedmsn' WHERE name='$nivusr'") or die("MSN error<br>");
$query11 = mysql_query("UPDATE `profile` SET sound='$media' WHERE name='$nivusr'") or die("Media error<br>");
$st = ('Your profile has succesfully been edited, do you wish to view it?<br /><br /><a href="http://www.nivade.com/profile/'. $nivusr .'">Click here!</a>');
noticebox($st);
exit();
}
if(!$nivusr) { echo("You must be logged in to edit your profile."); exit(); }
$getprofile = mysql_query("SELECT * FROM profile WHERE name = '$nivusr'");
$showprofile = mysql_fetch_array($getprofile); {
$oldage = ($showprofile['age']);
$oldtitle = ($showprofile['title']);
$oldge = ($showprofile['gender']);
$oldava = ($showprofile['myimg']);
$oldbout = ($showprofile['me']);
$oldmsn = ($showprofile['msn']);
$oldsex = ($showprofile['sexuality']);
$oldrel = ($showprofile['relatstat']);
$oldbio = ($showprofile['me']);
$oldskin = ($showprofile['skin']);
$oldmedia = ($showprofile['sound']);
}
echo('<form method="POST">
Values shown are the Current!<br><br>
Your age:<br>
<input type="text" name="age" value="'.$oldage.'"size="20"><br>
<br>
Title: (Shown under your username on your profile!);<br>
<input type="text" name="title" value="'.$oldtitle.'"size="50"><br>
<br>
Your gender:<br>
<select size="1" name="gender">
<option selected value="'.$oldge.'">'.$oldge.'</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
</select><br>
<br>
Your avatar Link:<br>
<input type="text" name="avatar" value="'.$oldava.'" size="50"><br>
<br>
A bit about you:<br>
<textarea rows="7" class="textarea" name="postbout" cols="60">'.$oldbout.'</textarea><br>
<br>
MSN Messenger Address:<br>
<input type="text" name="msn" value="'.$oldmsn.'" size="20" /><br /><br />
Sexuality:<br>
<select size="1" name="sexuality">
<option selected value="'.$oldsex.'">'.$oldsex.'</option>
<option value="Straight">Straight</option>
<option value="Lesbian">Lesbian</option>
<option value="Gay">Gay</option>
<option value="NotSure">Not Sure</option>
<option value="Bisexual">Bisexual</option>
</select><br>
<br>
Relationship status:<br>
<select size="1" name="relation">
<option selected value="'.$oldrel.'">'.$oldrel.'</option>
<option value="Married.">Married</option>
<option value="Divorced.">Divorced</option>
<option value="Single.">Single</option>
<option value="Not sure.">Not Sure</option>
<option value="Complicated.">Complicated</option>
<option value="Seeing.">Seeing someone</option>
</select><br>
<br>
Your profile skin:<br>
<select size="1" name="skin">
<option selected value="'.$oldskin.'">'.$oldskin.'</option>
');
$normal = 'Public';
$getallskins = mysql_query("SELECT * FROM skins WHERE setting = 'public' OR creator = '$nivusr'");
while($showskinselect = mysql_fetch_array($getallskins)) {
$showskinname = ($showskinselect['name']);
$creator = ($showskinselect['creator']);
echo('<option value="'.$showskinname.'">'.$showskinname.' - '.$creator.'</option>
');
}
echo('
</select><br>
<br><b>**** NEW *****</b> Music Media Player: (Insert link too the Media, this can only be music)<br /><br />
<input type="text" name="muzic" value="'. $oldmedia .'"><br /><br />
<input type="submit" value="Submit" name="profile">
</form>');
exit();
}
It removes the entries from the database, I moved to hostgator a day ago, and I get all the fields removed, other than smallbio, anyone help?
It's already connected to the database, I grabbed this code from a file which contains other "actions".
Also, it used to work before I moved server.
Hostgator use PHP 5.. I did a phpinfo(); if you need.
http://images.nivade.com/phpinfo.php (Dont ask why in image folder)
My previous server was running php 4.
if($_GET ['f'] == "profile") {
if($_POST[profile]) {
$newage = silence($_POST['age']);
$newtitle = silence($_POST['title']);
$newavata = silence(bbcode($_POST['avatar']));
$newsmallbio = silence(bbcode($_POST['smallbio']));
$newsex = silence(bbcode($_POST['sexuality']));
$newrela = silence(bbcode($_POST['relation']));
$newskin = silence(bbcode($_POST['skin']));
$cleanedmsn = silence(bbcode($_POST['msn']));
$newgender = silence(bbcode($_POST['gender']));
$media = silence(bbcode($_POST['muzic']));
$query1 = mysql_query("UPDATE `profile` SET age='$newage' WHERE name='$nivusr'") or die("Age error<br>");
$query2 = mysql_query("UPDATE `profile` SET title='$newtitle' WHERE name='$nivusr'") or die("Title error<br>");
$query3 = mysql_query("UPDATE `profile` SET myimg='$newavata' WHERE name='$nivusr'") or die("Avatar error<br>");
$query4 = mysql_query("UPDATE `profile` SET me='$postbout' WHERE name='$nivusr'") or die("Little Bio error<br>");
$query5 = mysql_query("UPDATE `profile` SET sexuality='$newsex' WHERE name='$nivusr'") or die("Sexuality error<br>");
$query6 = mysql_query("UPDATE `profile` SET relatstat='$newrela' WHERE name='$nivusr'") or die("Relationship error<br>");
$query8 = mysql_query("UPDATE `profile` SET skin='$newskin' WHERE name='$nivusr'") or die("Skin error<br>");
$query9 = mysql_query("UPDATE `profile` SET gender='$newgender' WHERE name='$nivusr'") or die("Gender error<br>");
$query10 = mysql_query("UPDATE `profile` SET msn='$cleanedmsn' WHERE name='$nivusr'") or die("MSN error<br>");
$query11 = mysql_query("UPDATE `profile` SET sound='$media' WHERE name='$nivusr'") or die("Media error<br>");
$st = ('Your profile has succesfully been edited, do you wish to view it?<br /><br /><a href="http://www.nivade.com/profile/'. $nivusr .'">Click here!</a>');
noticebox($st);
exit();
}
if(!$nivusr) { echo("You must be logged in to edit your profile."); exit(); }
$getprofile = mysql_query("SELECT * FROM profile WHERE name = '$nivusr'");
$showprofile = mysql_fetch_array($getprofile); {
$oldage = ($showprofile['age']);
$oldtitle = ($showprofile['title']);
$oldge = ($showprofile['gender']);
$oldava = ($showprofile['myimg']);
$oldbout = ($showprofile['me']);
$oldmsn = ($showprofile['msn']);
$oldsex = ($showprofile['sexuality']);
$oldrel = ($showprofile['relatstat']);
$oldbio = ($showprofile['me']);
$oldskin = ($showprofile['skin']);
$oldmedia = ($showprofile['sound']);
}
echo('<form method="POST">
Values shown are the Current!<br><br>
Your age:<br>
<input type="text" name="age" value="'.$oldage.'"size="20"><br>
<br>
Title: (Shown under your username on your profile!);<br>
<input type="text" name="title" value="'.$oldtitle.'"size="50"><br>
<br>
Your gender:<br>
<select size="1" name="gender">
<option selected value="'.$oldge.'">'.$oldge.'</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
</select><br>
<br>
Your avatar Link:<br>
<input type="text" name="avatar" value="'.$oldava.'" size="50"><br>
<br>
A bit about you:<br>
<textarea rows="7" class="textarea" name="postbout" cols="60">'.$oldbout.'</textarea><br>
<br>
MSN Messenger Address:<br>
<input type="text" name="msn" value="'.$oldmsn.'" size="20" /><br /><br />
Sexuality:<br>
<select size="1" name="sexuality">
<option selected value="'.$oldsex.'">'.$oldsex.'</option>
<option value="Straight">Straight</option>
<option value="Lesbian">Lesbian</option>
<option value="Gay">Gay</option>
<option value="NotSure">Not Sure</option>
<option value="Bisexual">Bisexual</option>
</select><br>
<br>
Relationship status:<br>
<select size="1" name="relation">
<option selected value="'.$oldrel.'">'.$oldrel.'</option>
<option value="Married.">Married</option>
<option value="Divorced.">Divorced</option>
<option value="Single.">Single</option>
<option value="Not sure.">Not Sure</option>
<option value="Complicated.">Complicated</option>
<option value="Seeing.">Seeing someone</option>
</select><br>
<br>
Your profile skin:<br>
<select size="1" name="skin">
<option selected value="'.$oldskin.'">'.$oldskin.'</option>
');
$normal = 'Public';
$getallskins = mysql_query("SELECT * FROM skins WHERE setting = 'public' OR creator = '$nivusr'");
while($showskinselect = mysql_fetch_array($getallskins)) {
$showskinname = ($showskinselect['name']);
$creator = ($showskinselect['creator']);
echo('<option value="'.$showskinname.'">'.$showskinname.' - '.$creator.'</option>
');
}
echo('
</select><br>
<br><b>**** NEW *****</b> Music Media Player: (Insert link too the Media, this can only be music)<br /><br />
<input type="text" name="muzic" value="'. $oldmedia .'"><br /><br />
<input type="submit" value="Submit" name="profile">
</form>');
exit();
}