Jump to content

Click Submit Button.. Page Coming Up Blank?


Stalingrad

Recommended Posts

Hi! My forum was working fine a few days ago, I made absolutely NO changes to it what-so-ever, the only thing I did was change the hosting company I am with. The huge problem I am having with, with a few different scripts that I have programmed is when I hit the submit button on a GET, it goes back to the original .php. Like, for example, my original page is: page.php. The GET would be page.pgp?action=reply.. when I hit the submit on the reply GET, it goes back to page.php With an almost blank page, just the basic page... on whatever is on the page.php. Here is my code for the first page I am having problems with (just the part I am having the problem with)... if you request it, I can post the entire thing)...

if(isset($newtopic)) {
$name = $_POST['tname'];
$tbody = $_POST['tbody'];
$tcat = $_POST['tcat'];
$nownow = $_POST['submit'];
if(!isset($nownow)) {
?>
<form action="<?php echo "$PHP_SELF"; ?>" method="POST">
Topic Title: <input type="text" name="tname"><br>
<select name="tcat"><option value="1">General Chat</option>
<option value="2">Help Chat</option>
<option value="3">Roleplaying</option>
<option value="4">Avatars</option>
<option value="5">Art</option>
<option value="6">Buying, Trading, Selling</option>
</select><br><br>Body:<br><textarea name="tbody" cols="38" rows="8"></textarea><br><br><input type="submit" name="submit" value="CreateTopic"></form>
<?php
}
if(isset($nownow)) {
mysql_query("INSERT INTO topics (name, username, body, countit, boardin, created) VALUES ('$name', '$showusername', '$tbody', '0', '$tcat', 

'$sitetime')");
mysql_query("UPDATE category SET topics=topics+1 WHERE catid='$tcat'");
mysql_query("UPDATE users SET posts=posts+1 WHERE username='$showusername'");
echo "<font color=green>Success! Your Topic has been created.</font>";
}
echo "meeba.";
}

 

And the other page I am having trouble with, is a a code I have just recently coded. It worked fine on my old hosting company, however, upon switching to my new host, the same problem has happened:

<?php
session_start();
include("file.php");
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<?php
if(!isset($_SESSION['username'])) {
echo "<banner></banner><nav>$shownavbar</nav><ubar><a href=login.php>Login</a> or <a href=register.php>Register</a></ubar><content><center><font size=6>Error!</font><br><br>You are not Logged In! Please <a href=login.php>Login</a> or <a href=register.php>Register</a> to Continue!</center></content>";
}

if(isset($_SESSION['username'])) {
echo "<nav>$shownavbar</nav><ubar>$ubear</ubar><content><center><font size=6>Messages</font><br><br><br><br>";

$action = $_GET['action'];

if($action=="not") {
"not";
}

elseif ($action=="out") {
echo "Outbox.";
}

elseif ($action=="delete") {
echo "Delete.";
}

elseif($action=="compose") {
$body = $_POST['body'];
$ruply = $_POST['ruply'];
$tetle = $_POST['tetle'];
$towho = $_POST['towho'];
echo "<font size=5>Compose Message</font><br><br>";
if(!isset($ruply)) {
?>
<form action="<?php echo "$PHP_SELF"; ?>" method="POST">
Title: <input type="text" name="tetle"><br>
To: <input type="text" name="towho"><br><br>
<textarea name="body" rows="8" cols="32"></textarea><br><br><input type="submit" name="ruply" value="Send Message"><br><br></form>
<?php
}

if(isset($ruply)) {
$chekq = "SELECT * FROM users WHERE username='$towho'";
$cheky = mysql_query($chekq);
$chek = mysql_num_rows($cheky);
if($chek < "1") {
echo "<font color=red>Error! That user doesn't Exist!</font><br><br>";
?>
<form action="<?php echo "$PHP_SELF"; ?>" method="POST">
Title: <input type="text" name="tetle"><br>
To: <input type="text" name="towho"><br><br>
<textarea name="body" rows="8" cols="32"></textarea><br><br><input type="submit" name="ruply" value="Send Message"><br><br></form>
<?php
}
if($towho == "") {
echo "<font color=red>Error! Please fill out the entire form!</font><br><br>";
?>
<form action="<?php echo "$PHP_SELF"; ?>" method="POST">
Title: <input type="text" name="tetle"><br>
To: <input type="text" name="towho"><br><br>
<textarea name="body" rows="8" cols="32"></textarea><br><br><input type="submit" name="ruply" value="Send Message"><br><br></form>
<?php
}
if($towho != "" && $chek >= "1") {
mysql_query("INSERT INTO `umessages`(`userto`, `userfrom`, `title`, `body`, `date`, `read`) VALUES ('$towho', '$showusername', '$tetle', '$body', '$sitetime', 'No')");
echo "<font color=green>Success! Your message has been Sent!</font><br><br><a href=?action=inbox>Back to Inbox</a><br><br>";
}
}

}

elseif ($action=="inbox") {
echo "<a href=?action=compose>Compose Message</a><br><br>";
echo "<table border=1 bordercolor=black cellpadding=6 cellspacing=0><tr><td><center>From</center></td><td><center>Title</center></td><td><center>Date</center></td><td><center>Read?</center></td></tr>";
$getmq = "SELECT * FROM umessages WHERE userto='$showusername'";
$getm = mysql_query($getmq);
while($mrow = mysql_fetch_array($getm)) {
$mid = $mrow['mid'];
$mtit = $mrow['title'];
$mfrom = $mrow['userfrom'];
$mto = $mrow['userto'];
$mbody = $mrow['body'];
$mre = $mrow['read'];
$mdate = $mrow['date'];

echo "<tr><td><center><a href=lookup.php?username=$mfrom>$mfrom</a></center></td><td><center><a href=?action=view&mid=$mid>$mtit</a></center></td><td><center>$mdate</center></td><td><center>$mre</center></td></td></tr>";
}
echo "</table>";
echo "<br><br>";
}
elseif($action=="send") {
echo "Send.";
}
elseif($action=="view" ) {
$thisid = $_GET['mid'];
$goreply = $_POST['reply'];
$myreply = $_POST['replys'];

$vq = "SELECT * FROM umessages WHERE mid=$thisid";
$vit = mysql_query($vq);
while($yrow = mysql_fetch_array($vit)) {
$tid = $yrow['mid'];
$tfrom = $yrow['userfrom'];
$tto = $yrow['userto'];
$tbody = $yrow['body'];
$tread = $yrow['read'];
$tdate = $yrow['date'];
$ttit = $yrow['title'];
}
echo "<table border=1 bordercolor=black cellpadding=6 cellspacing=0 width=398px><tr><td><center><font size=5>$ttit</font><br>From: <a href=lookup.php?username=$tfrom>$tfrom</a>      $tdate</center></td></tr><tr><td><center><br>$tbody<br><br></center></td></tr></table><br><br><br>";
?>
<form action="<?php echo "$PHP_SELF"; ?>" method="POST">
<textarea rows="6" cols="20" name="replys">Write a reply...</textarea><br><br>
<input type="submit" name="reply" value="Submit Reply"></form><br><br>
<?php
}
if(isset($goreply)) {
mysql_query("INSERT INTO `umessages`(`userto`, `userfrom`, `title`, `body`, `date`, `read`) VALUES ('$tfrom', '$showusername', '$ttit', '$myreply', '$sitetime', 'No')");
echo "<font color=green>Success! Your Reply has been sent!</font><br><br><a href=?action=inbox>Back to Inbox</a><br><br>";
}

}
?>

</html>

 

Please... if anybody could guide me with some help, it would be so much appreciated, thank you!

Link to comment
Share on other sites

I made absolutely NO changes to it what-so-ever, the only thing I did was change the hosting company I am with.
You did absolutely nothing to it but change the entire execution environment, PHP.ini, the web server version, the web server config, and possibly the PHP version.

 

It's like reformatting your computer. Things change when you do that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.