473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

error in php code

sanjay123456
125 100+
hello sir...
plz check the coding....jsp functions are not working...
Sir plz check the following code and point out me errror


[PHP]
<?
include('../include/site_config.php');

####################################
/* @PAGGING */
####################################

//Variable Declaration
$array_user = array();
$i=0;
//Pagging Variable
$display_per_page = 10;
$row_count = 0;
$total_page = 0;
$page_no = 0;
if(isset($_REQUEST['page']))
$selected_page_no = $_REQUEST['page'];
else
$selected_page_no = 1;
//End Pagging Variable

#############################################

$i = 0;
$login_user = array();

$sqlQuery = "SELECT id, fname, mname, lname, email,
countries.countries_name, status
FROM customer, countries
WHERE customer.country = countries.countries_code_2
ORDER BY fname";
$rsQuery = mysql_query( $sqlQuery );
while($row = mysql_fetch_object( $rsQuery )) {
$login_user[$i]['id'] = $row->id;
$login_user[$i]['name'] = stripslashes($row->fname)."
".stripslashes($row->mname)." ".stripslashes($row->lname);
$login_user[$i]['email'] = stripslashes($row->email);
$login_user[$i]['country'] = $row->countries_name;
$login_user[$i]['status'] = $row->status;
$i++;
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel = 'stylesheet' href = '..\admin.css'>
<script language="JavaScript">
function send_form( id, page ) {
window.location.href = "add_category.php&page="+page;
}
function send_form_edit( cust_id, page ) {
window.location.href = "customer.php
?cust_id="+cust_id+"&page="+page;
}
function pagging( page ) {
window.location.href = "index.php?page="+page;
}
function delcom(id, page) {
var ans = window.confirm("Are you sure you want to delete?");
if(ans)
window.location.href =
'del_user.php?cust_id='+id+'&page='+page;
}
function status_check( mode, cust_id, page_no ){
window.location.href = "index.php
?mode="+mode+"&cust_id="+cust_id+"&page="+page_no;
}
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth='0' marginheight='0'>
<table cellpadding="0" cellspacing="0" border="0" width="600"
align="center">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td colspan = '3' class = 'mainHeader'>Customer
Manager</td>
</tr>
<tr>
<td width="45%" height="22"
class="tableCell_banner_V"><a href="customer.php?page=<?=$selected_page_no
?>">Add Customer</a></td>
<td width="55%" height="22" colspan = '2'
class="tableCell_banner_V">&nbsp;</td>
</tr>
</table>
<table width="100%" cellspacing="1" cellpadding="2"
border="0">
<tr class="searchResult" height="18">
<td width="7%" align="center"><b>SNo.</b></td>
<td width="18%"
align="center"><b>Name</b></td>
<td width="20%"
align="center"><b>Email</b></td>
<td width="18%"
align="center"><b>Country</b></td>
<td width="16%"
align="center"><b>Edit</b></td>
<td width="21%"
align="center"><b>Delete</b></td>
</tr>
<? //paging

//total record
if(count($login_user) > 0)
$row_count =
count($login_user);

$from = $display_per_page * (
$selected_page_no-1 );
$to = $display_per_page *
$selected_page_no;
$row_no = $from + 1;

$total_page =
ceil(count($login_user)/$display_per_page);
if($total_page == 0)
$total_page = 1;
//end
$show_rows_on_screen = 0;

for( $i=$from; $i<$to; $i++ ) {
if($show_rows_on_screen ==
$display_per_page || !isset($login_user[$i]['id']) )
break;
$show_rows_on_screen++;
?>
<tr class="tableCell">
<td align="center"
valign="top">&nbsp;<?=$i+1 ?></td>
<td align="center"
valign="top">&nbsp;<?=$login_user[$i]['name'] ?></td>
<td align="center"
valign="top">&nbsp;<?=$login_user[$i]['email'] ?></td>
<td align="center"
valign="top">&nbsp;<?=$login_user[$i]['country'] ?></td>
<td align="center"
valign="top">&nbsp;<a
href="javascript:send_form_edit(<?=$login_user[$i]['id']
?>,<?=$selected_page_no ?>);"><img border='0' src='../images/edit_icon.gif'
alt='Edit'></a></td>
<td align="center"
valign="top">&nbsp;<a href="javascript:delcom(<?=$login_user[$i]['id'] ?>,
<?=$selected_page_no ?>)" ><img border='0' src='../images/b_drop.gif'
alt='Delete'></a></td>
</tr>
<? } ?>
<tr height="22">
<td colspan="6">&nbsp;</td>
</tr>
<tr class="tableCell" height="22">
<td colspan="6" align="right">
<?
//echo "page :";
for($i=1; $i<=$total_page; $i++) {
if( ($page_no+$i)==$selected_page_no
) {
echo " ";
echo "[".($page_no+$i)."]";
} else {
?>
<a
href="javascript:pagging(<?=($page_no+$i) ?>)"><? echo "[".($page_no+$i)."]"
?></a>
<? }//End If
}//For
?>&nbsp;&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>

[/PHP]

sanjay
Dec 1 '06 #1
3 1369
ronverdonk
4,258 Expert 4TB
Firstly, there is no JSP code in your code, I see just JavaScript, which is very different from JSP.

Secondly, a statement like "it is not working" does not give much of information on "what" is not working. So, please answer these questions, so we can help you:

- what function or part of the code is not working?
- what have you done to find the error, what debug statements and traces?

Ronald :cool:
Dec 1 '06 #2
sanjay123456
125 100+
Sir ,

sorrry for that its js code error menas java script function
java script functiion r not work menas its give blank page sir


sanjay
Dec 2 '06 #3
ronverdonk
4,258 Expert 4TB
Firstly, there is no JSP code in your code, I see just JavaScript, which is very different from JSP.

Secondly, a statement like "it is not working" does not give much of information on "what" is not working. So, please answer these questions, so we can help you:

- what function or part of the code is not working?
- what have you done to find the error, what debug statements and traces?

Ronald :cool:
And what about the 'please answer these questions' answers as asked in the previous reply? 'It does not work': what have you done yourself to isolate the possible error? After >20 threads you should know that you'll first have to try yourself to isolate your problem.

Your thread title says: error in php code! Apparently it is not, it is in the javascript code.

Ronald :cool:
Dec 2 '06 #4

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

Similar topics

5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
16
by: Steve Jorgensen | last post by:
I'm trying to figure out if there is a way to generate standard error handlers that "know" if the calling code has an error handler in effect (On Error Goto <label> or On Error Resume Next) before...
6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
4
by: Eugene Anthony | last post by:
One problem with the code bellow is after this code conn.qDupUser p1,rs I added: set rs = nothing to test the error handling capability.
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.