stickyladder Posted November 21, 2012 Share Posted November 21, 2012 Hello, I'm new to coding. I just moved my php site to another server (linux). Now some of my links work and others don't. Please see sample of short file below. Please help, I'm desperate. Note: on below code, the first link does not work, but the other two do. I can find no difference. The first one universityreport.php resolves to a blank page. <snip> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1%"><img src="images/gray-box-left.jpg" width="11" height="84" /></td> <td width="98%" background="images/gray-box-mid.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left"><a href="universityreport.php"><img src="images/coll-card.jpg" width="265" height="61" border="0" /></a></td> <td align="center"><a href="jobsearch.php"><img src="images/minority-bank.jpg" width="265" height="61" border="0" /></a></td> <td align="right"><a href="registerempolyer.php"><img src="images/corp-portal.jpg" width="265" height="61" border="0" /></a></td> </tr> </table></td> <td width="1%"><img src="images/gray-box-ryt.jpg" width="11" height="84" /></td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/ Share on other sites More sharing options...
mrMarcus Posted November 21, 2012 Share Posted November 21, 2012 Doesn't work in what manner? You receive a Page Not Found error? Please expand. Does universityreport.php exist on the server? Are you now receiving PHP errors? If so, post them. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394096 Share on other sites More sharing options...
stickyladder Posted November 21, 2012 Author Share Posted November 21, 2012 Please note that all of the three files above are in the same directory...... Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394107 Share on other sites More sharing options...
stickyladder Posted November 21, 2012 Author Share Posted November 21, 2012 When you click on the link, the url changes to this [http://www.stickyladder.net/login.php?next=dW5pdmVyc2l0eXJlcG9ydC5waHA=] and the results are a blank page. All of the 3 files are in the root directory (httpdocs) on the server. I receive no php errors except the blank page. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394109 Share on other sites More sharing options...
mrMarcus Posted November 21, 2012 Share Posted November 21, 2012 Have you checked your error_log's? Do you have error_reporting on? There may be an issue with your code in that file since the move to a new server. Did the PHP version also change? Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394111 Share on other sites More sharing options...
mrMarcus Posted November 21, 2012 Share Posted November 21, 2012 Just by checking the source code of the link you provided, your script cuts short immediately following </head>. So, it is likely that your PHP code it tripping up there. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394112 Share on other sites More sharing options...
stickyladder Posted November 21, 2012 Author Share Posted November 21, 2012 My php version has changed (upgraded), but the logic is not clear. Why would two of the links work and not the other? If the script cuts short, wouldn't it affect all three of the hyper links? Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394113 Share on other sites More sharing options...
Pikachu2000 Posted November 21, 2012 Share Posted November 21, 2012 All of the links, in actuality, work. They are all result in a document being requested by the browser, and they all then generate output. The problem is the output terminates early in the one that you perceive as not working. The problem is not with the link per se, but with the script being requested. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394115 Share on other sites More sharing options...
PFMaBiSmAd Posted November 21, 2012 Share Posted November 21, 2012 The link you posted is to the login page. That implies that your universityreport.php page expects the visitor to be logged in and redirects to the login page when they are not. Since the login.php page stops producing the html document before it outputs any visible content, your first step would be to troubleshoot why the code in login.php isn't doing anything after that point. The only way we could possibly help you do that would be if you post all the code for loigin.php (less any database connection details.) Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394123 Share on other sites More sharing options...
stickyladder Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) ok, this is becoming a bit more clear.. following please see code for login page.. /* * To change this template, choose Tools | Templates * and open the template in the editor. */ require('includes/application_top.php'); require('includes/header_top.php'); include("includes/breadcrumb.php"); $user = new user(DB_CONNECTION); $page=base64_decode($_REQUEST['next']); if(isset($_POST['submit']) && $_POST['login'] && $_POST['password']){ if($user->login($_POST['login'],$_POST['password'])){ if($_REQUEST['next']!="") { //$page=base64_decode($_REQUEST['next']); header("Location:$page"); exit; } else { header("location:".generateURL('myaccount.php', true)); } } else { $error = 'You have entered invalid login details Or account not activated now.'; } } else if($_POST['submit']){ $error = "Please enter login details."; } ?> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <!-- header logo --> <?php include('includes/headerlogo.php'); ?> <!-- header logo --> </td> </tr> <tr> <td> <!-- header information ---> <?php include('includes/header.php'); ?> <!-- header information ---> </td> </tr> <tr> <td height="20"> </td> </tr> <tr> <td> <!-- header link ---> <?php include('includes/headerlink.php'); ?> <!-- header link ---> </td> </tr> <tr> <td align="left"> <?php $trail = new Breadcrumb(); $trail->add('Login', $_SERVER['PHP_SELF'], 1,'Y'); echo " <style> #breadcrumb ul li{ list-style-image: none; display:inline; padding: 0 3px 0 0; margin: 1px 0 0 0; font-size:12px; color:blue; } #breadcrumb ul{ margin:0;padding:0; list-style-type: none; padding-left: 1em; } </style> "; //Now output the navigation. $trail->output(); ?> </td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td> <!--middle content ---> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" valign="top"> <table width="96%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="19" colspan="2" class="menu-txt"><strong>RETURNING USERS SIGN IN</strong></td> </tr> <tr> <td width="18%" height="76" valign="top" background="images/ico_folder_large.jpg" style="background-position:top left; background-repeat:no-repeat"> </td> <td width="82%" valign="top" class="sml-blk-txt" align="justify"> <form action="<?php if($_REQUEST['next']!='') { echo('login.php?next='.$_REQUEST['next']); } else { echo generateURL('login.php', true); } ?>" method="post"> <table> <?php if($error) echo '<tr><td colspan="2"><span class="error">'.$error.'</span></td></tr>'; ?> <tr> <td>User Name or Email:</td> <td><input type="text" name="login" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" /></td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" class="green_btn" value="Sign In" /> </td> </tr> <tr> <td align="center" colspan="2"> <a href="<?php generateURL('forgetpassword.php')?>">Forgot Password?</a> </td> </tr> </table> <input type="hidden" name="submit" value="submit" /> </form> </td> </tr> <tr> <td colspan="2" align="center"> </td> </tr> </table> </td> <td width="50%" valign="top"> <table width="96%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="19" colspan="2" class="menu-txt"> </td> </tr> <tr> <td width="18%" height="76" valign="top" background="images/ico_man_large.jpg" style="background-position:top left; background-repeat:no-repeat"> </td> <td width="82%" valign="middle" class="sml-blk-txt" align="justify"> <a href="<?php if($page=="") { echo('registration.php'); } elseif($page =="universityreport.php") { echo("reportcard.php"); } ?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','images/get-starting1.png',1)"> </a> </td> </tr> </table> </td> </tr> </table> <!--middle content ---> </td> </tr> <tr> <td> </td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td height="50" > <!--Foooter Content ---> <?php include('includes/footer.php'); ?> <!--Foooter Content ---> </td> </tr> </table> <?php include('includes/header_bottom.php'); ?> Edited November 21, 2012 by PFMaBiSmAd post code using code tags please Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394125 Share on other sites More sharing options...
mrMarcus Posted November 21, 2012 Share Posted November 21, 2012 ok, this is becoming a bit more clear.. following please see code for login page.. I'm glad it is for somebody Unless the issue is something that pops right out, this could be an all-day guessing game. You need to ensure error_reporting is on and errors are being logged. That way, we've got something to work with. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394134 Share on other sites More sharing options...
PFMaBiSmAd Posted November 21, 2012 Share Posted November 21, 2012 Is there some reason you didn't post the first part of your login.php code? Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394144 Share on other sites More sharing options...
stickyladder Posted November 21, 2012 Author Share Posted November 21, 2012 i posted the entire file. Maybe I made a mistake. I will double check. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394186 Share on other sites More sharing options...
mrMarcus Posted November 21, 2012 Share Posted November 21, 2012 Seriously, man. Just check your error logs (or enable error logging if not already enabled). Could be something as simple as a syntax error in includes/application_top.php, but we've never know it. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394191 Share on other sites More sharing options...
PFMaBiSmAd Posted November 21, 2012 Share Posted November 21, 2012 The reason I asked about the start of your file not being posted is because nothing you have posted contains the html that we have been mentioning that IS being output on that page. Unfortunately, your code is trying to paste together the page by using php include/require statements. So, we still don't know exactly at what point your code is doing what you expect and at what point it is not. So far, mrMarcus has suggested/asked that you set php's error_reporting to E_ALL and either set display_errors to ON or set log_errors to ON. The sooner you do this, the sooner the problem will get found. Quote Link to comment https://forums.phpfreaks.com/topic/270988-a-href-link-not-resolving/#findComment-1394195 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.