can you put if(mysql_num_rows($result) > 0) before the while()

The dynamically created rows are appended at the end of the table i.e. after the last row of the table (found by table.rows.length)
and those individual contains 8 more s carrying some texts and their respective text fields.
Now we have one such default , which also contains button for adding more row , onclick of which the addRow() function is called to create the dynamic row each time.
The code is created dynamically that's fine so far.
But when the form is submitted the default textfield's (from the default) values are found in the echo of post data but not other .
The same script works fine in IE and shows all the elements textfield's values in the textfield POST data along with the default one, after form submit echo.

This is the simple script to do the same-
[CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Calc function calculate() { value_1 = document.getElementById("val1").value; value_2 = document.getElementById("val2").value; value_3 = document.getElementById("val3").value; alert(parseInt(value_1)+parseInt(value_2)); document.getElementById("val4").value = (parseInt(value_1)+parseInt(value_2)) - parseInt(value_3); } [/CODE]

id_tariffplan is the variable to hold the first parameter value passed to the stored procedure.
So its not a column name.Either the error is "unknown column idtariffplan" , (where idtariffplan is the column name) and id_tariffplan will just assign its value to it in the where clause.

yes, its cool too, but the process by ajax will be done in the backend.
page won't refresh while sending the mail.

Now save this as send_mail.php-
$name = $_GET['name'];
$email_id = $_GET['id'];
$body = $_GET['body'];
$subject = "This is the subject";

echo "Done";
else{ echo "Failed";}


var req = createXMLHttpRequest();

function createXMLHttpRequest() {
var ua;
if(window.XMLHttpRequest) {
try {
ua = new XMLHttpRequest();
} catch(e) {
ua = false;
} else if(window.ActiveXObject) {
try {
ua = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
ua = false;
return ua;

function sendRequest()
//var rnd982g = Math.random();
// var str = "";
var url= 'send_mail.php';
if(document.getElementById('txtName') !='' && document.getElementById('txtName') != null)
url +="?name="+document.getElementById('txtName').value;
if(document.getElementById('txtMail') !='' && document.getElementById('txtMail') != null)
url +="&id="+document.getElementById('txtName').value;
alert("enter email address");
return false;
if(document.getElementById('txtBody')!='' && document.getElementById('txtBody')!=null)
alert("email body is empty");
return false;
}'GET', url);
req.onreadystatechange = handleResponse;
return false;


function handleResponse() {
if(req.readyState == 4){
var response = req.responseText;
document.getElementById("results").innerHTML = response;

<? ?>

Name Email Address Body

Now you need the send_mail.php to send the actual mail

yes you can validate in php only,
For example, validate against the blank field like -
if($str ==''){ echo "You have not entered anything";}
or you can use the regular expressions for checking the correct format of data like format of email id etc.
and size exceeding more than 100 char as -
if(strlen($str) >100) { echo "exceeding the limit of 100 chars"; }

whenever i am working on local host it work fine but after uploading file on internet
this script not deleting any records
what do i do????[/QUOTE]
so what error you getting on the server?
Again you including the login.html and using <?php echo $user; ?> in the script, $user gets set in the html file??
check with this or post your login.html too here

Will Gresham commented: Use code and icode tags :( +0

browse around you will get thousand of free website design templates

yes you can always do that provided that the field name has unique constraint on it.Otherwise you will end up deleting more than one row with the same field name but different ids.
Is this a duplicate thread you created. If in case, you forgot the one, after you created it, you can always see the threads started by you in the profile or else browse the threads subscribed by you; both options accessible from the control panel one of the menu from the row of top header menus

put the break in the default and forgot the closing brace of last else if()

your query is failing for sure, echo the query and post it here.
or else execute the query directly inside the mysql and post ,if any error you got there

look for .htaccess on apache


mark the thread as solved

mark the thread as solved ,if you are satisfied with the solutions provided

mark the thread as solved

what was the need for this, if the problem is solved please mark the thread as solved

somedude3488 commented: Don't bump 2 year old threads. It's annoying. -1

The file download form the server to the client machine will be done by the php, but before that restricting the user in some way or the client side validation will help to achieve what you want exactly with the javascript.