Stalingrad Posted October 18, 2012 Share Posted October 18, 2012 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! Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/ Share on other sites More sharing options...
Christian F. Posted October 18, 2012 Share Posted October 18, 2012 Turn on error reporting in php.ini, or check the server's error logs. The reason for this fatal error should be provided to you then. Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/#findComment-1386149 Share on other sites More sharing options...
ManiacDan Posted October 18, 2012 Share Posted October 18, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/#findComment-1386152 Share on other sites More sharing options...
Stalingrad Posted October 18, 2012 Author Share Posted October 18, 2012 Yes. thank you guys. I did contact my web host and they changed the php version back to php 3 and it worked fine. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/#findComment-1386157 Share on other sites More sharing options...
Pikachu2000 Posted October 18, 2012 Share Posted October 18, 2012 PHP 3? You can't be serious. Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/#findComment-1386158 Share on other sites More sharing options...
ManiacDan Posted October 18, 2012 Share Posted October 18, 2012 Where did you even find a web host which would voluntarily give you a version of PHP which was FOURTEEN YEARS OLD? Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/#findComment-1386159 Share on other sites More sharing options...
requinix Posted October 18, 2012 Share Posted October 18, 2012 The $_GET and $_POST and such superglobals were introduced in 4.1. You are not running PHP 3. Thank God. Quote Link to comment https://forums.phpfreaks.com/topic/269648-click-submit-button-page-coming-up-blank/#findComment-1386163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.