Can't reload or refresh index.php

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
I have been working on rewriting my site needless to say my old one needed much improvement. I'm trying to write my entire site into 1 php file so that web bots can read all the text. Everything was going good until I put in my menus button code. Now if nothing else is in IE it will load but if you try to refresh or click on any of the buttons which reloads the index.php I get a blank screen. I have even tryed to take the new code out and I'm still having the problem. Here is the whole code if you need help reading it let me know but I think I have enough tags in it.

Code:
<body>
<font color="white">
<script language="php">
session_start(); // Starts session so that the variables can be read

//$page=$_POST['page'];

if(isset($_SESSION['hb']))// sees if the veriable is active yet
	$hb = $_SESSION['hb']; // reads session variables
//print ("this is working");
else 
$_SESSION['hb'] = ("4");
$hb = $_SESSION['hb']; // reads session variables





function head($a){
	// This section sees if there is already a header being used by the user

if ($a=="4") {
$hb = rand(1,3);	// Sets up which header, Buttons, and Side backgrounds will be used

}
else {
	$hb=($a);
	
}
// Sets up the header table

$hbl = ("images\header\hb".$hb.".jpg");
print ("<table border=\"0\" width=\"100%\"> <tr>");

if ($hb =="1"){
	print ("<td width=\"21.5\" bgcolor=\"teal\">");
}
elseif ($hb =="2"){
	print ("<td width=\"21.5\" bgcolor=\"darkblue\">");
	
}
elseif ($hb=="3"){
	print ("<td width=\"21.5\" bgcolor=\"purple\">");
}

print ("</td><td width=\"56%\" background=\"".$hbl."\">");
print ("<table width=\"100%\"> <tr><td width=\"33%\">");
print ("<img src=\"images\logo.png\">");
print ("</td><td width=\"33%\">");
print ("<center>");
print ("<font color=\"white\"> 77 Camp St Suite 145 <br>  Meriden Ct. 06450 <br>   (203)361-0886 </font>");
print ("</td>");
print ("<td width=\"33%\">");
print ("</td></tr></table>");

if ($hb =="1"){
	print ("<td width=\"21.5\" bgcolor=\"teal\">");
}
elseif ($hb =="2"){
	print ("<td width=\"21.5\" bgcolor=\"darkblue\">");
	
}
elseif ($hb=="3"){
	print ("<td width=\"21.5\" bgcolor=\"purple\">");
}
print ("</td></tr></table>");
return $hb ;
}

function sbr($a){
// Sets up the right side Bar
$bg= ("images\Side Bar\sb".$a.".jpg"); // gets the location of the side bar background	

print ("<table width=\"100%\"><tr>");
print ("<td width=\"16.5%\" background=\"".$bg."\" valign=\"top\">");
print ("<img src=\"images\partners\dell.jpg\" width= \"75%\" height = \"75%\">");
print ("<br><br>");
print ("<img src=\"images\partners\acer.jpg\" width= \"75%\" height = \"75%\">");
print ("<br>");

if ($a=="3"){
	$bar=("images\buttons\purple\bar.gif");
}
else {
	$bar=("images\buttons\blue\bar.gif");
}
print ("<br>");
print ("<img src=\"".$bar."\" width= \"100%\" height = \"50%\">");
print ("<br>");

// Mojo Badge

print ("<script type=\"text/javascript\" src=\"http://c.mojopages.com/sstatic/bizWidgetEmbed/41103062/awards_c93003000.js\"></script>
<div id=\"mojo_widget_41103062\" class=\"mojoSkyscraperWidget widgetBlue\" style=\"width: 160px;\">
 <div class=\"skyscraper\">
  <a href=\"http://www.mojopages.com/\" class=\"mojoAwardsWrapper\">
   <img src=\"http://c.mojopages.com/mstatic/images/widgets/mojo_awards_logo_medium.png\" alt=\"Yellow Pages\" />
  </a>
  <div class=\"mojoRibbonWrapper\">
   <div class=\"mojoRibbonBackground\"></div>
   <div class=\"mojoRibbonLeft\"></div>
   <div class=\"mojoRibbonRight\"></div>
   <span id=\"ribbon_name_41103062\" class=\"businessName\">KC Computers LLC.</span>
  </div>
  <div class=\"mojoMainWrapper\">
   <div class=\"mojoMainLeft\"></div>
   <div class=\"mojoMainRight\"></div>
   <div class=\"mojoContents\">
    <div id=\"mojoRankWrapper\" class=\"mojoRankWrapper\">
    <span id=\"mojoCurrentlyRanked\">Currently Ranked</span>
     <div id=\"currentRank_41103062\" class=\"\"></div>
     <a class=\"mojoMeta\" href=\"http://www.mojopages.com/computer-repair/meriden/ct#41103062\">
      <span id=\"location_41103062\" class=\"mojoLocation\">Meriden</span>
      <span id=\"category_41103062\" class=\"mojoCategory\">Computer Repair</span>
     </a>
    </div>
    <a id=\"vote_for_us_41103062\" class=\"mojoVoteButton\" href=\"http://www.mojopages.com/biz/kc-computers-llc/meriden/ct/06450/41103062\" alt=\"KC Computers LLC.\">Vote For Us</a>
    <span id=\"mojo_voting_ends_41103062\" class=\"mojoVotingEnds\">VOTING ENDS: <span id=\"ends_41103062\"></span></span>
    <div id=\"mojo_countdown\" class=\"mojoCountdown\">
     <table cellpadding=\"0\" cellspacing=\"0\">
      <tbody>
       <tr>
        <td class=\"days\"><span class=\"number\"><span id=\"days\">0</span></span></td>
        <td class=\"hours\"><span class=\"number\"><span id=\"hours\">00</span></span></td>
        <td class=\"minutes\"><span class=\"number\">:<span id=\"mins\">00</span></span></td>
        <td class=\"seconds\"><span class=\"number\">:<span id=\"secs\">00</span></span></td>
       </tr>
      </tbody>
     </table>
    </div>
   </div>
  </div>
  <ul id=\"reviews_41103062\" class=\"reviews\" style=\"height: 314px;\"></ul>
  <div class=\"mojoFooter\">
   <span>See all <a id=\"footer_name_41103062\" href=\"http://www.mojopages.com/biz/kc-computers-llc/meriden/ct/06450/41103062\">0</a> Votes</span>
  </div>
 </div>
</div> ");


print ("<br>");

if ($a=="3"){
	$bar=("images\buttons\purple\bar.gif");
}
else {
	$bar=("images\buttons\blue\bar.gif");
}
print ("<br>");
print ("<img src=\"".$bar."\" width= \"100%\" height = \"50%\">");
print ("<br>");



// backlink
</script>

<?php
// THE FOLLOWING BLOCK IS USED TO RETRIEVE AND DISPLAY LINK INFORMATION.
// PLACE THIS ENTIRE BLOCK IN THE AREA YOU WANT THE DATA TO BE DISPLAYED.

// MODIFY THE VARIABLES BELOW:
// The following variable defines whether links are opened in a new window
// (1 = Yes, 0 = No)
$OpenInNewWindow = "1";

// # DO NOT MODIFY ANYTHING ELSE BELOW THIS LINE!
// ----------------------------------------------
$BLKey = "WE00-14V5-E3D5";

if(strlen($_SERVER['SCRIPT_URI'])){
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_URI'].((strlen($_SERVER['QUERY_STRING']))?'?'.$_SERVER['QUERY_STRING']:'');
}

if(!strlen($_SERVER['REQUEST_URI'])){
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].((strlen($_SERVER['QUERY_STRING']))?'?'.$_SERVER['QUERY_STRING']:'');
}

$QueryString  = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&Key=" .urlencode($BLKey);
$QueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);


if(intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
    @readfile("http://www.backlinks.com/engine.php?".$QueryString); 
}
elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
    if($content = @file("http://www.backlinks.com/engine.php?".$QueryString)) 
        print @join('', $content);
}
elseif(function_exists('curl_init')) {
    $ch = curl_init ("http://www.backlinks.com/engine.php?".$QueryString);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_exec ($ch);

    if(curl_error($ch))
        print "Error processing request";

    curl_close ($ch);
}
else {
    print "It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information.";
}
?>
            
            
            
          </p>
          <p>    <?php
// THE FOLLOWING BLOCK IS USED TO RETRIEVE AND DISPLAY LINK INFORMATION.
// PLACE THIS ENTIRE BLOCK IN THE AREA YOU WANT THE DATA TO BE DISPLAYED.

// MODIFY THE VARIABLES BELOW:
// The following variable defines whether links are opened in a new window
// (1 = Yes, 0 = No)
$OpenInNewWindow = "1";

// # DO NOT MODIFY ANYTHING ELSE BELOW THIS LINE!
// ----------------------------------------------
$BLKey = "T2ZZ-4W3N-2H72";

if(strlen($_SERVER['SCRIPT_URI'])){
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_URI'].((strlen($_SERVER['QUERY_STRING']))?'?'.$_SERVER['QUERY_STRING']:'');
}

if(!strlen($_SERVER['REQUEST_URI'])){
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].((strlen($_SERVER['QUERY_STRING']))?'?'.$_SERVER['QUERY_STRING']:'');
}

$QueryString  = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&Key=" .urlencode($BLKey);
$QueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);


if(intval(get_cfg_var('allow_url_fopen')) && function_exists('readfile')) {
    @readfile("http://www.backlinks.com/enginec.php?".$QueryString); 
}
elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
    if($content = @file("http://www.backlinks.com/enginec.php?".$QueryString)) 
        print @join('', $content);
}
elseif(function_exists('curl_init')) {
    $ch = curl_init ("http://www.backlinks.com/enginec.php?".$QueryString);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_exec ($ch);

    if(curl_error($ch))
        print "Error processing request";

    curl_close ($ch);
}
else {
    print "It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information.";
}
?></p>
          
<P><A HREF="http://www.backlinks.com/?aff=81572" target="_blank">
<IMG SRC="http://www.backlinks.com/images/125X125.jpg" BORDER="0" WIDTH="125" HEIGHT="125" ALT="make money with your web site">
</A>


<script language="php">
print ("</td>");
}

function sbl($a){
// Sets up the right side Bar
$bg= ("images\Side Bar\sb".$a.".jpg"); // gets the location of the side bar background	


print ("<td width=\"16.5%\" background=\"".$bg."\" valign=\"top\">");

// login form
</script>
<form id="form2" name="form2" method="post" action="index.php"><center> <h3> Login </h3> </center>
 <br />
 e-Mail:   		
 <input type="text" name="email" id="email" />
 <br />
 Password: 
 <input type="password" name="Password" id="Password" />
 <br />
  <input type="submit" name="login" id="login" value="Login" />
 <input type="submit" name="newuser" id="newuser" value="New User" />
</form>
<script language="php">

if ($a=="3"){
	$bar=("images\buttons\purple\bar.gif");
}
else {
	$bar=("images\buttons\blue\bar.gif");
}
print ("<br>");
print ("<img src=\"".$bar."\" width= \"100%\" height = \"50%\">");
print ("<br>");

// Manta link
</script>

<a href="http://www.manta.com/c/mrn01s4/kc-computers"><img src="http://www.manta.com/manta/images/mantaBadge_sm.png" height="20" width="55" border="0" /></a>

<script language="php">

// Twitter Link
</script>

<p><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="KCComputersLLC">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

<script language="php">

// Facebook Link

if ($a=="1"){
	facebook1();
}
else {
	facebook2();
}



print("</td></tr></table>");
}

function mid($a){ //this is the new code
	print ("<td width=\"66\" valign=\"top\">");
	print ("<center>");
   // Sets up th buttons at the top of the screen	
 print ("    <form id=\"form1\" name=\"form1\" method=\"post\" action=\"index.php\">
<input type=\"image\" src=\"images\buttons\blue\hc.gif\" alt=\"Submit button\" name=\"home\" id=\"home\" >
<input type=\"image\" src=\"images\buttons\blue\suc.gif\" alt=\"Submit button\" name=\"services\" id=\"services\" >
<input type=\"image\" src=\"images\buttons\blue\buc.gif\" alt=\"Submit button\" name=\"blog\" id=\"blog\" >
<input type=\"image\" src=\"images\buttons\blue\gbuc.gif\" alt=\"Submit button\" name=\"gb\" id=\"gb\" ><input type=\"image\" src=\"images\buttons\blue\qtuc.gif\" alt=\"Submit button\" name=\"qt\" id=\"qt\" >
<input type=\"image\" src=\"images\buttons\blue\cuuc.gif\" alt=\"Submit button\" name=\"cu\" id=\"cu\" >
</form>");   
    	
	print ("</td>");
}

function bottum($a){
	
	// sets up the color for the bottom of the screen
	print ("<table width=\"100%\"><tr>");
	if ($a =="1"){
	print ("<td width=\"21.5\" bgcolor=\"teal\">");
	print ("test");
}
elseif ($a =="2"){
	print ("<td width=\"21.5\" bgcolor=\"darkblue\">");
	print ("test");
}
elseif ($a=="3"){
	print ("<td width=\"21.5\" bgcolor=\"purple\">");
	print ("test");
}
print ("</td></tr></table>");

}

function facebook1(){
// dark background
</script>

<p><iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FKC-Computers%2F104334019651404&width=292&colorscheme=dark&show_faces=true&border_color&stream=true&header=true&height=590" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:234px; height:590px;" allowTransparency="true"></iframe></p>

<script language="php">
}

function facebook2(){
	//Light Background
	</script>

<p><iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FKC-Computers%2F104334019651404&width=200&colorscheme=light&show_faces=true&border_color=blue&stream=true&header=true&height=427" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:427px;" allowTransparency="true"></iframe></p>

<script language="php">
}





if ($hb=="4"){
$hb=head($hb);
sbr($hb);
mid($hb);
sbl($hb);
bottum($hb);
}

else {
}

$_SESSION['hb'] = ($hb);
</script>
</body>
</html>

here is just the code that seemed to mess everything up

Code:
function mid($a){ //this is the new code
   print ("<td width=\"66\" valign=\"top\">");
   print ("<center>");
   // Sets up th buttons at the top of the screen   
 print ("    <form id=\"form1\" name=\"form1\" method=\"post\" action=\"index.php\">
<input type=\"image\" src=\"images\buttons\blue\hc.gif\" alt=\"Submit button\" name=\"home\" id=\"home\" >
<input type=\"image\" src=\"images\buttons\blue\suc.gif\" alt=\"Submit button\" name=\"services\" id=\"services\" >
<input type=\"image\" src=\"images\buttons\blue\buc.gif\" alt=\"Submit button\" name=\"blog\" id=\"blog\" >
<input type=\"image\" src=\"images\buttons\blue\gbuc.gif\" alt=\"Submit button\" name=\"gb\" id=\"gb\" ><input type=\"image\" src=\"images\buttons\blue\qtuc.gif\" alt=\"Submit button\" name=\"qt\" id=\"qt\" >
<input type=\"image\" src=\"images\buttons\blue\cuuc.gif\" alt=\"Submit button\" name=\"cu\" id=\"cu\" >
</form>");   
       
   print ("</td>");
}

Thank you for our help
Christopher J. Crandall
 
I figured it out it was actually the if statement at the end I forgot that what I was working on was just for when you first enter the site so any refresh or click would show up as a blank screen because I have nothing there yet lol.

Thank you again
Christopher J. Crandall

ps. this is why proof reading is so important :D
 
Back
Top