By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

query was empty and login form just keeps looping

matheussousuke
100+
P: 249
The website opens, doesn't show any connection errors, but I can't make any query.

If I try to login, I get back to the login page, if I try to make a Search, I get an error inside the website field "Query was empty".


It happened when I moved the website to a domain folder, I configured everything correctly, so I don't know what's going on...


Now I moved it to another web host account, the full website's on the root, and I still get those errors.


Bellow is the main file, it is loaded by every page of the site:


Expand|Select|Wrap|Line Numbers
  1. <?
  2. /*session_start();*/
  3. include "configuration.inc.php";
  4. include "connect.php";
  5.  
  6. $day = date(d);
  7. $month = date(m);
  8. $year = date(Y);
  9.  
  10. $del = "delete from job_post where EXday = \"$day\" and EXmonth = \"$month\" and EXyear = \"$year\" ";
  11. $rdel = mysql_query($del) or die(mysql_error());
  12. ?>
  13. <HTML>
  14. <HEAD>
  15. <TITLE><?=$sitenameheading?></TITLE>
  16. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  17. <style type="text/css">
  18. <?= "$style"; ?>
  19. </style>
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. <link href="css/common.css" rel="stylesheet" type="text/css" />
  29. <link href="css/our_work.css" rel="stylesheet" type="text/css" />
  30. <script type="text/javascript">
  31.         var GB_ROOT_DIR = "./greybox/";
  32.     </script>
  33. <script type="text/javascript" src="greybox/AJS.js"></script>
  34. <script type="text/javascript" src="greybox/AJS_fx.js"></script>
  35. <script type="text/javascript" src="greybox/gb_scripts.js"></script>
  36. <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" /></HEAD>
  37.     <BODY link="#000000" vlink="#000000" alink="#000000"  TOPMARGIN=0 MARGINHEIGHT=0">
  38.  
  39. <table width="900" border="0" cellpadding="0" cellspacing="0" align="center" background="../images/postbg2.jpg">
  40.  <tr>
  41.     <td></td>
  42. </tr>
  43.   <tr>
  44.     <td> <TABLE WIDTH=90  CELLPADDING=0 CELLSPACING=0>
  45.  
  46.         <TR>            <TD><div style="
  47.         background:url(../images/header.jpg);
  48.         width:900;
  49.         height:150;
  50.         border-color:#0099FF;
  51.  
  52.  
  53.                 border-width:1px;
  54.         border-style:solid;"></div>
  55. </TD>
  56.         </TR>
  57.       </TABLE></td>
  58.   </tr>
  59.   <tr>
  60.     <td><table width="100%" class="dott2" border="0" cellspacing="0" cellpadding="4">
  61.         <tr valign="top"> 
  62.           <td width="200">
  63.           <table width="200" class="dott3" border="0" cellpadding="2" cellspacing="0">
  64. <?
  65. if(!isset($uname) && !isset($upass)) {
  66.  
  67. echo " 
  68. <tr>
  69. <td bgcolor='$s4employersblock' height='05'></td>
  70.  
  71. </tr>
  72.  
  73. <tr> 
  74.  
  75.  
  76.  
  77.                 <td><strong> <font color='$s3white'><li class='menutext'><a href='http://$myurl/index.php'>HOME</a></font></li>
  78.                  </td>
  79.               </tr>
  80.  
  81.               <tr> 
  82.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/siteadmin/index.php'>Área restrita</a></li>
  83.                  </td>
  84.               </tr>
  85.  
  86.  
  87.  
  88.  
  89. <td bgcolor='$s4employersblock'><strong> <font color='$s3white'>&nbsp;$JOBSEEKERS</font></strong><br>
  90. <form name=jsl method='post' action='http://$myurl/jobseekers/login.php'>
  91. <table>
  92. <tr>
  93.     <td>$USERNAME1</td>
  94.     <td align=right> <input type='text' name='uname' size='15'></td>
  95. </tr>
  96.  
  97. <tr>
  98.     <td>$PASSWORD1</td>
  99.     <td align=right><input type='password' name='upass' SIZE='15'></td>
  100. </tr>
  101.  
  102. <tr>
  103.     <td colspan=2 align=right>
  104.     <input type=hidden name=job_id value=$_GET[job_id]>
  105.     <input type='submit' name=submit value='Entrar'></td>
  106. </tr>
  107.  
  108. <tr><td colspan=2 align=center> <a class=TN href=http://$myurl/jobseekers/forgot.php>Lembrar Senha?</a></td></tr>
  109.  
  110. </table>
  111. </form>
  112.                 </td>
  113.               </tr>
  114.  
  115. <tr> 
  116.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/login.php'>$LOGIN</a></li>
  117.                  </td>
  118.               </tr>
  119. <tr> 
  120.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/jobseeker_registration.php'>$JOINFORFREE</a></li>
  121.                  </td>
  122.               </tr>
  123.                             <tr> 
  124.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/post-resume.php'>$POSTRESUME</a></li></td>
  125.               </tr>
  126.               <tr> 
  127.                 <td bgcolor=$s12menu class='menutext'> <li class='menutext'><a href='http://$myurl/jobseekers/edit-resume.php'>$EDITRESUME</a></li></td>
  128.               </tr>
  129.               <tr> 
  130.                 <td bgcolor=$s12menu> <li class='menutext'>
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.                 <a href=\"http://$myurl/jobseekers/preview.php\" rel=\"gb_page[630, 500]\">{$VIEWRESUME}</a>
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.                 </li></td>
  161.               </tr>
  162.               <tr> 
  163.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/job-search.php'>$SEARCHJOBS</a></li></td>
  164.               </tr>
  165.               ";
  166.  
  167. }
  168. else
  169. {
  170.  
  171. echo "         <tr>     
  172.                 <td width='116' bgcolor='$s4employersblock'><strong> <font color='$s3white'>&nbsp;$JOBSEEKERS</font></strong><br>
  173. <tr> 
  174.                 <td width='116' bgcolor='#f2f2f2'><strong> <font color='#666666'>&nbsp;$WELCOME ".$_SESSION['uname']."</font></strong></td>
  175.               </tr>
  176. <tr> 
  177.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/index.php'>$HOME</a></li></td>
  178.               </tr>
  179.               <tr> 
  180.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/post-resume.php'>$POSTRESUME</a></li></td>
  181.               </tr>
  182.               <tr> 
  183.                 <td bgcolor=$s12menu class='menutext'> <li class='menutext'><a href='http://$myurl/jobseekers/edit-resume.php'>$EDITRESUME</a></li></td>
  184.               </tr>
  185.               <tr> 
  186.                 <td bgcolor=$s12menu> <li class='menutext'>
  187.  
  188.  
  189.  
  190.                             <a href=\"http://$myurl/jobseekers/preview.php\" rel=\"gb_page[630, 500]\">{$VIEWRESUME}</a>
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                 </li></td>
  197.               </tr>
  198.               <tr> 
  199.                 <td bgcolor=$s12menu class='menutext'> <li class='menutext'><a href='http://$myurl/jobseekers/upload.php'>$UPLOADIMG</a></li></td>
  200.               </tr>
  201.               <tr> 
  202.                 <td bgcolor=$s12menu class='menutext'> <li class='menutext'><a href='http://$myurl/jobseekers/cvupload.php'>$UPLOADCV</a></li></td>
  203.               </tr>
  204.               <tr> 
  205.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/job-search.php'>$SEARCHJOBS</a></li></td>
  206.               </tr>
  207.               <tr> 
  208.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/delete.php'>$DELETEACC</a></li></td>
  209.               </tr>
  210.               <tr> 
  211.                 <td bgcolor=$s12menu> <li class='menutext'><a href='http://$myurl/jobseekers/logout.php'>$LOGOUT</a></li></td>
  212.               </tr>
  213.  
  214.               ";
  215.  
  216. }
  217. ?>
  218.  
  219. <?
  220. $nResult = mysql_query("SELECT * FROM job_employer_info WHERE ename = \"$ename\" ");
  221.  
  222. $nRow = mysql_fetch_array($nResult);
  223.  
  224. if(!isset($ename) && !isset($epass)) {
  225.  
  226. echo "<tr><td height=164 bgcolor=#DEEDFF>
  227.  
  228.  
  229.  
  230.  
  231.  
  232.           <object width='200' height='250'
  233. classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'
  234. codebase='http://fpdownload.macromedia.com/
  235. pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>
  236. <param name='SRC' value='http://mistercursos.com.br/images/banners/bannermg.swf'>
  237. <param name='scale' value='exactfit'/><embed src='http://mistercursos.com.br/images/banners/bannermg.swf' width='200' height='250'>
  238. </embed>
  239. </object>
  240.  
  241.  
  242. <td></tr>";
  243.  
  244.  
  245.  
  246.  
  247. echo "<tr> 
  248.                 <td bgcolor=$s4employersblock><strong><font color=$s3white>&nbsp; $EMPLOYERS</font></strong><br>
  249. <form name=el method='post' action='http://$myurl/employers/index.php'>
  250. <table>
  251. <tr>
  252.     <td>$USERNAME1</td>
  253.     <td align=right> <input type='text' name='ename' size='15'></td>
  254. </tr>
  255.  
  256. <tr>
  257.     <td>$PASSWORD1</td>
  258.     <td align=right><input type='password' name='epass' SIZE='15'></td>
  259. </tr>
  260.  
  261. <tr>
  262.     <td colspan=2 align=right>
  263.     <input type='submit' name=submit value='Entrar'></td>
  264. </tr>
  265.  
  266. <tr><td colspan=2 align=center> <a class=TN href=http://$myurl/employers/forgot.php>Lembrar Senha?</a></td></tr>
  267.  
  268. </table>
  269. </form>        </td></tr>
  270.               <tr> 
  271.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/PostJob.php'>$LOGIN</a></li></td>
  272.               </tr>
  273.               <tr> 
  274.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/registre-sua-empresa.php'>$REGISTER</a></li></td>
  275.               </tr>
  276.               <tr> 
  277.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/PostJob.php'>$POSTJOB</a></li></td>
  278.               </tr>
  279. <tr>
  280.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/EmployerSearch.php'>$SEARCH</a></li></td>
  281.               </tr>";
  282. }
  283. else
  284. {
  285. echo "
  286. <tr> 
  287.                 <td bgcolor=$s4employersblock><strong><font color=#FFFFFF>&nbsp; $EMPLOYERS</font></strong>
  288.                 </td></tr>              
  289. <tr> 
  290.                 <td width='116' bgcolor='#f2f2f2'><strong> <font color='#666666'>&nbsp;$WELCOME ".$_SESSION['ename']."</font></strong></td>
  291.               </tr>
  292. <tr> 
  293. <tr>
  294.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/index.php'>$HOME</a></li></td>
  295.               </tr>
  296.               <tr> 
  297.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/PostJob.php'>$POSTJOB</a></li></td>
  298.               </tr>
  299. <tr>
  300.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/employers7.php'>$MANAGEJOBS</a></li></td>
  301.               </tr>
  302.              <!-- <tr> 
  303.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/employers1.php'>$UPDATEPLAN</a></li></td>
  304.               </tr> !-->
  305.               <tr> 
  306.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/employers12.php'>$EDITINFOMENU</a></li></td>
  307.               </tr>
  308.               <tr> 
  309.                 <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/upload.php'>$UPLOADLOGO</a></li></td>
  310.               </tr>
  311.               <tr> 
  312.                               <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/EmployerSearch.php'>$SEARCH</a></li></td>
  313.               </tr>
  314.               <tr> 
  315.                               <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/delete.php'>$DELETEACC</a></li></td>
  316.               </tr>
  317.               <tr>
  318.               <tr> 
  319.                               <td bgcolor=$s12menu> <li class=menutext><a href='http://$myurl/employers/logout.php'>$LOGOUT</a></li></td>
  320.               </tr>
  321.               <tr>
  322.                  <td bgcolor='#9FC728'><strong><font color='$s3white'>&nbsp;Disponibilidade da Conta</font></strong></td>
  323.               </tr>
  324.               <tr> 
  325.                 <td>    
  326.                 $CANPOST <b>vagas.</b><br>
  327. $CANVIEW <b>currículos.</b> 
  328.                 </td>
  329.               </tr>";
  330. }
  331. echo"
  332.   <tr>
  333.     <td  bgcolor='$s4employersblock'><strong><font color=$s3white>&nbsp;&nbsp;</font></strong></td>
  334.   </tr>
  335.   <tr>";
  336.  
  337. $xa = "SELECT * FROM job_employer_info where featured = '1' order by ename asc LIMIT 10";
  338. $xb = mysql_query($xa) or die(mysql_error());
  339.   while($xc = mysql_fetch_array($xb))
  340.   {
  341. echo "<td bgcolor=$s4employersblock><li class=menutext>
  342.  
  343.  
  344.  
  345.     <a href=\"$site/employerview.php?ename=$xc[ename]\" rel=\"gb_page[630, 500]\">$xc[CompanyName]</a>";
  346.  
  347.  
  348.  
  349.   }
  350.  
  351. ?>
  352.             </table>
  353.           </td>
  354.           <td>
  355.  
  356.  
  357.  
  358. </BODY>
  359. </HTML>






Please help....
Oct 28 '11 #1
Share this Question
Share on Google+
2 Replies


omerbutt
100+
P: 638
hi matheussousuke,
where is the code for the login.php file can you paste it here
regards,
Omer Aslam.
Nov 2 '11 #2

matheussousuke
100+
P: 249
Sorry, forgot to mark as solved. It's solved.
Nov 2 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.