Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PHP
<pre lang="HTML"><body>
<form id="FromID" name="FromID" method="post">
<br><br>
<div align="center" style="font-family:Rockwell,Courier Bold,sans-serif; font-size:22px;font-weight:bold;">SMS Status </div>
<br><br>
<table style="border: 1px solid black" border="1" cellpadding="0"  cellspacing="0" align="center" width="25%" class="style"> 		
		<tr>
			<td>Group Name</td>
			<td><input type="text" name="grp" id="grp"></td>
        	<script language="javascript">$('#grp').val("<?php echo $_POST['grp'];?>")</script>			
	    </tr>
		<tr>
		    <td>Subscribtion Number</td>
			<td><input type="text" name="num" id="num"></td> 	
			<script language="javascript">$('#num').val("<?php echo $_POST['num'];?>")</script>			
		</tr>	
        <tr>
		<td colspan ="2" align="center">
		<input type="submit" name="Submit" id="Submit" value="Submit" />
		</td>
		</tr>		
</table>
<br>

<?php
if(isset($_POST['Submit']))
{
$group=$_POST['grp'];
$subscribe=$_POST['num'];

if($_POST['grp']=="" || $_POST['num']=="")
{
echo "Enter valid Group Name and Subscribtion number";
}
else
{
$q= "select send_date_d,grp_name_vc,subr_no_i,send_type_vc,result_vc,brn_id_vc,subr_mobile_vc,subr_name_vc  from tblsmsstatus
where grp_name_vc='$group' and subr_no_i='$subscribe'";
}
$result = mssql_query($q,$link);
  echo $q;
  echo "<table class='TFtable' border ='1' align ='center' cellpadding='1' cellspacing='1'  width='800' bgcolor='#FFFFFF' style='border:1px solid #0080FF;' >";
  echo "<tr><th style='background:#58ACFA;'>S.No</th>
	      <th style='background:#58ACFA;'>Date</th>
		  <th style='background:#58ACFA;'>Name</th>
		  <th style='background:#58ACFA;'>Group Name</th>
	      <th style='background:#58ACFA;'>Subscribtion Number</th>
	      <th style='background:#58ACFA;'>Send Type</th>
		  <th style='background:#58ACFA;'>Result</th>
		  <th style='background:#58ACFA;'>Branch</th>
		  <th style='background:#58ACFA;'>Mobile</th><tr>";	
		  
		  $i=1;
		
		while($row=mssql_fetch_assoc($result))
		{
			?>
			<tr bgcolor="#CEF6F5">
			    <td align="center" style="padding-right:px;text-decoration:none;">
                	<?php echo $i;?>
                </td>				
			    <td align="center"  style="padding-left:10px;text-decoration:none;">
                	
					<?php echo $row['send_date_d'];?>
                </td>
			    <td align="center"  style="padding-left:10px;text-decoration:none;">
                	<?php echo $row['subr_name_vc'];?>
                </td>
    			 <td align="center"  style="padding-left:10px;text-decoration:none;">
                	<?php echo $row['grp_name_vc'];?>
                </td>
				<td  align="center"  style="padding-left:10px;text-decoration:none;">
                	<?php echo $row['subr_no_i'];?>
                </td>
				 <td align="center"  style="padding-left:10px;text-decoration:none;">
					<?php echo $row['send_type_vc'];?>
				</td>	
                 <td align="center"  style="padding-left:10px;text-decoration:none;">
                	<?php echo $row['result_vc'];?>
                </td>
			    <td align="center"  style="padding-left:10px;text-decoration:none;">
                	<?php echo $row['brn_id_vc'];?>
                </td>
				<td align="center"  style="padding-left:10px;text-decoration:none;">
                	<?php echo $row['subr_mobile_vc'];?>
                </td>			
            </tr>				
		 <?php
		  $i++;
		  } 		   
        }
		  ?>
		  </table>
 </form>
</body>



What I have tried:

$server='MYSERVER NAME'
$link = mssql_connect('$server', '$user', '$pwd');
if (!$link)
{
die('ERROR: Could not connect: ' . mssql_get_last_message());
}

Plz help me where I went wrong??? The data gets displayed in SQL SERVER whereas its not getting displayed in Chrome Browser
Posted
Comments
Sinisa Hajnal 30-Mar-16 6:03am    
You don't get any error, but the data is not shown? Or you get an error? You have to describe what happens, not just post million lines of html.

Relevant line is (I guess) id="num"? Try moving script tag under table element. Put type="text/javascript" into script tag. Check that $POST['num'] actually contains value...you know, debug.
alia007 30-Mar-16 6:05am    
I dont get any error ...but the value is not getting fetched? I dont know to debug

1 solution

After including its respective config file...its working !!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900