Shanti C 106 Posting Virtuoso

check the code below:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script type="text/javascript">

var states = new Array();

states['Canada'] = new Array('Alberta','British Columbia','Ontario');
states['Mexico'] = new Array('Baja California','Chihuahua','Jalisco');
states['United States'] = new Array('California','Florida','New York');


// City lists
var cities = new Array();

cities['Canada'] = new Array();
cities['Canada']['Alberta']          = new Array('Edmonton','Calgary');
cities['Canada']['British Columbia'] = new Array('Victoria','Vancouver');
cities['Canada']['Ontario']          = new Array('Toronto','Hamilton');

cities['Mexico'] = new Array();
cities['Mexico']['Baja California'] = new Array('Tijauna','Mexicali');
cities['Mexico']['Chihuahua']       = new Array('Ciudad Juárez','Chihuahua');
cities['Mexico']['Jalisco']         = new Array('Guadalajara','Chapala');

cities['United States'] = new Array();
cities['United States']['California'] = new Array('Los Angeles','San Francisco');
cities['United States']['Californialinks'] = new Array('LosAngeles.html','SanFrancisco.html');
cities['United States']['Florida']    = new Array('Miami','Orlando');
cities['United States']['Floridalinks']    = new Array('Miami.html','Orlando.html');
cities['United States']['New York']   = new Array('Buffalo','new York');
cities['United States']['New Yorklinks']   = new Array('Buffalo.html','new York.html');


function setStates() {
  cntrySel = document.getElementById('country');
  stateList = states[cntrySel.value];
  changeSelect('state', stateList, stateList);
  setCities();
}

function setCities() {
  cntrySel = document.getElementById('country');
  stateSel = document.getElementById('state');
  cityList = cities[cntrySel.value][stateSel.value];
  cityLinksList = cities[cntrySel.value][stateSel.value+"links"];
  changeSelect('city', cityList, cityLinksList);
}

function changeSelect(fieldID, newOptions, newValues) {
  selectField = document.getElementById(fieldID);
  selectField.options.length = 0;
  for (i=0; i<newOptions.length; i++) {
    selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]);
  }
}

// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  setStates();
});
function redirect()
{
	x=document.getElementById("city").value;
	window.location=x;
}
</script>

<style type="text/css">
  .make_selection_back { …
Shanti C 106 Posting Virtuoso

If you want to redirect to particular link based on drop down selection, user go button and capture the selected element in drop down, and redirect url.
Try to implement code and post your code here to fix.

Shanti C 106 Posting Virtuoso

i didn't get you clearly.

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

I have just given you an idea not exact code.
Then try yourself for the error like:
try to trace out the where is the error.
Means put echo for all posted data,
next echo the query and execute the query in PHPMYAdmin.
or post your entire code.

Shanti C 106 Posting Virtuoso

if condition always takes == for comparison

if($answer == "")

Shanti C 106 Posting Virtuoso

try like this:

$link.="<a href=\"test.php/verify_email/$vcode\" target=_blank>Verify email address</a>";
Shanti C 106 Posting Virtuoso

$query = "select student.Rollno, departments.Dept_name, student.Name, student.PercentsgeSoFar from student inner join(departments
inner join studentdept on studentdept.Dept_id = departments.Dept_id)on student.Rollno = studentdept.Rollno ";

in the above query use alias names like as shown below:

$query = "select student.Rollno rollno, departments.Dept_name deptname, student.Name sname, student.PercentsgeSoFar percent from student inner join(departments
inner join studentdept on studentdept.Dept_id = departments.Dept_id)on student.Rollno = studentdept.Rollno ";

the print like this:

echo $row['rollno']. "  " . $row['deptname']."     ". $row['sname']."     ". $row['PercentageSoFar'];
Shanti C 106 Posting Virtuoso

check this:

,'$message')";

for varchar field you need to send string in between single quotes.

Shanti C 106 Posting Virtuoso

check this:

<?php 
$dblink="test1.php";
if($_POST['link']=="old")
echo $_POST['finalLink'];
else
echo $_POST['finalLink'];
?>
<head>
<script type="text/javascript">
function clickRadio()
{
	if(newForm.link[0].checked==true)
	{
		newForm.newLink.value="";
		newForm.newLink.disabled =true;
	}
	else if(newForm.link[1].checked==true)
	{
		newForm.newLink.disabled =false;
		newForm.newLink.focus();
	}
}
function validate()
{
	if(newForm.link[0].checked==true)
		newForm.finalLink.value=newForm.oldLink.value;
	else if(newForm.link[1].checked==true)
		newForm.finalLink.value=newForm.newLink.value;
	alert(newForm.finalLink.value);
}
</script>

</head>
<BODY >
<br>
<br>
<form name='newForm' method='post' action=''>

<Input type = 'Radio' Name ='link' value= 'old' onClick="clickRadio();">Old
<input type="hidden" name="oldLink" value="<?php echo $dblink;?>">
<Input type = 'Radio' Name ='link' value= 'new' onClick="clickRadio();">New
<input type="text" name="newLink" value="">

<input type="hidden" name="finalLink" value="">
<br>
<br>
<input type="submit" name="submit" value="Submit" onclick="validate();">
</form>

</BODY>
</HTML>
Shanti C 106 Posting Virtuoso

Yes, it is a better idea that you can do this by url rewriting .
for this you need to do some steps.
check these links for clear information step by step:
http://phpcreating.blogspot.com/2010/07/create-dynamic-subdomain-using-mod.html
http://www.reconn.us/content/view/46/67/

Shanti C 106 Posting Virtuoso

i tested the code and its not working its not inserting the data in database nor is it redirecting me to the payment page.

check your form action ,what is the redirect page name you have written there.If it is alertpayment.php page then change it to insert.php.

one thing should my form.php file be in the same directory as my insert.php?

off course, if your page is in other directory, you can give clear path of that page.

Shanti C 106 Posting Virtuoso

Some where else you have written select query ,check once again in included pages also.
Your update query is quietly perfect.
This error is because you don't have privileges to use select command or you are not logged in to database as administrator.

Shanti C 106 Posting Virtuoso

Use encryption methods before saving the credit card information in your database.
or
Use third party payment gateway , the will take care of all these.
then you need not to save credit card information in your database.

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

some thing like this:

<script type="text/javascript">
function revalidate()
{
alert("test");
	test1=document.getElementById("test1").value;
	test2=document.getElementById("test2").value;
	window.location="revalidate.php?test1="+test1+"&test2="+test2;
}
</script>
<form name="pass" action="validate.php" method="post">

<input type="text" name="test1" id="test1">
<input type="text" name="test2" id="test2">
<a href="javascript:revalidate();">revalidate</a> 
<input type="Submit">
</form>
Shanti C 106 Posting Virtuoso

try this:
Lets assume $myvar variable is having values like:

$myvar='8','9','10';

and in your java script:

jsvar =new Array(<?php echo $myvar;?>);

then you can run a loop through java script variable like"

for(var k=0;k<jsvar.length;k++)
{
alert(jsvar[k]);
}
Shanti C 106 Posting Virtuoso

check this is working:

document.writeln("<tr><td style=\"background-color:#FFFF00;\">" + "test" + "</td></tr>");
Shanti C 106 Posting Virtuoso

Anything is valuable in two situations:
First - Before getting it.
Second - After loosing it.

Shanti C 106 Posting Virtuoso

then try his:

$d = mktime(0,0,0,date("m"),1,date("Y"));
echo "Date: ".date("M/Y/d", $d);
Shanti C 106 Posting Virtuoso

whenever your are going to generate a bill then use this function to get current date:

echo Date('M/Y/d');

and save this in your database.

Shanti C 106 Posting Virtuoso

in the above code where is the $row defined.
i think it is missing.Please check.
and print mysql_num_rows($result); , whether it is returning rows or not.
and also check your insert query once.

Shanti C 106 Posting Virtuoso

Servlets in java

Shanti C 106 Posting Virtuoso

you can succeed best and quickest by helping others to succeed.

Shanti C 106 Posting Virtuoso

try to change these lines like as shown below:

$imagecontent = $row['content'];
$type=$row['type'];
header("Content-type: .$type.");
print $imagecontent ;
Shanti C 106 Posting Virtuoso

you have to give unique id for dynamically added input fields.Based on that ids you should have to calculate total.

Shanti C 106 Posting Virtuoso

try to print the query string $_REQUEST['case']; and print this query and execute that query in phpmyadmin: echo "SELECT * FROM query WHERE case_no = '$case'"; and also try to change the code like:

$result_id1 = mysql_query("SELECT * FROM query order by case_id");
while($row1=mysql_fetch_array($result_id1))
{
$cno=$row1[case_no];
//case_no is a field in the table "query"
echo "<TD><b><a href='http://localhost/test/details.php?case=$cno'> $cno</a></b> </TD>";
}
Shanti C 106 Posting Virtuoso

place the error checking code in same page in which the form code is.

Shanti C 106 Posting Virtuoso

like this:

$imagecontent = $row[content];
header("Content-type: .$row[type].");
print $imagecontent ;
Shanti C 106 Posting Virtuoso

inside insert.php wouldnt that just delete everyting inside our table we have just inserted on submiting the form?

flag=0 means unsuccessful transactions.

$q="insert into tablename ('','','','flag')values('','','',1)";

by this query , you will have flag 1 for all successful transactions.
So, no worry about unsuccessful transactions.

Don't run email code when transaction is unsuccessful.
Means if control went through success.php , means transaction is success.
and email that particular users details not all details.

Shanti C 106 Posting Virtuoso

so i should add the code
PHP Syntax (Toggle Plain Text)

1.
$q="delete from table name where flag=0";

$q="delete from table name where flag=0";
to my sucess.php file or fail.php?

No you just add the above query in the page from which we are going to payment page.not in success.php or fail.php pages.

Shanti C 106 Posting Virtuoso

hmm
here all we have to work with queries only.
first alter your table with flag like:

ALTER TABLE `table_name` ADD `flag` TINYINT NOT NULL DEFAULT '0';

then in insert.php page, your insert query should be like:

$q="insert into tablename ('','','','flag')values('','','',1)";

means here you insert the flag as 1 along with transaction information.because you don't know whether it will be success or fail.
and in your success.php, update your table row like:

update table name set flag=0 where primarykey=key;

then it means if flag=0 then it is your successful transaction.
and in payment page write this query to delete all unsuccessful payments:

$q="delete from table name where flag=0";

or just post your code for clear information.
thanks.

Shanti C 106 Posting Virtuoso

hmm.

check through this:

$query=mysql_query("SELECT * FROM Persons WHERE Id ='$Id'");
if (mysql_num_rows($query)==0)
Shanti C 106 Posting Virtuoso

ok then set flag and display button based on flag.

Shanti C 106 Posting Virtuoso

or try this:

[B] if ($name!="")[/B]
    {
       //start upload
       $location = "avatars/$name";
       move_uploaded_file($tmp_name,$location);

       $query = mysql_query("UPDATE Persons SET imagelocation='$location' WHERE Id ='$Id'");
   
       die("Your Profile Picture has been uploaded! <a href='member.php'>Back to Profile</a>");



    }
    else
    die("Please Select a File!");
Shanti C 106 Posting Virtuoso

first , i need some clarification,
what is the topic feature if that topic is locked????

and
set "is_lock" flag in your topics table in database,
then set it to 1 if it is locked, default is 0 means it is not locked.

Shanti C 106 Posting Virtuoso

i have to manually delete the temp store data in the database

you just write a query to delete unsuccessful transactions like:

$q="delete from table name where flag=0";

put this query before going to alertpayment.php
then all unsuccessful transactions will be deleted on regular basis.

Shanti C 106 Posting Virtuoso

ok then try this:

$("#owner_state").val($("#subject_state :selected").val());

this will work fine.

Shanti C 106 Posting Virtuoso

do i really have to submit the form data to a database or can i store it in some kind of variable

Yes.
if we stored all the data in some global variable,while payment or after payment if close our website, all the data set will be lost even if successfully done payment.

at lease get a sample of the code for the success.php file

i don't have any examples with me.
try to code like:
- a query to make inserted row flag with 1.
user customer if to find proper row which cam through success.php
- emailing functionality.
First try it and post here if you have any more queries.

Shanti C 106 Posting Virtuoso

before going to alertpayment page ,you just insert all data in your database with flag 0.
if payment is successfull in alertpayament, then redirect to success.php page in your website, in that success.php you just write code to make that inserted row flag to 1.then write code to email these details.
if payment is not successfull in alertpayament,then redirect it to failure.php page.
then delete the inserted data or leave that with flag 0.

the rows with flag 1 are meant to your successful transcations.

Shanti C 106 Posting Virtuoso

ok sorry.
try this:

$("#owner_state :selected").val($("#subject_state :selected").val());
Shanti C 106 Posting Virtuoso

ok.good.

Shanti C 106 Posting Virtuoso

you want something like this:

$i=1;
   while($i<10)
   {
	   if($i==1)
	   {
		   print "id : "+$i;
		   echo "<br>";
	   }
	   else
	   {
		   echo "id : "+$i+" , ";	
		   echo "boxid : "+($i-1);
		   echo "<br>";
	   }
	   $i++;
   }
Shanti C 106 Posting Virtuoso

when you are submitting your form then redirect it to one page called insert.php,
then redirect to https://www.alertpay.com/checkout".
just like this:

<form id="feedbackform" method="post" action="insert.php" >

in insert.php

// getting form values
//inserting code
// form
<script>
document.feedbackform.submit();
</script>
<form id="feedbackform" method="post" action="https://www.alertpay.com/checkout" >
// put required fields in hidden variable

</form>
Shanti C 106 Posting Virtuoso

check this once:

$("input#owner_dropdownname.option:selected").val($("input#subject_dropdownname.option:selected").val());

check the link for reference:
http://api.jquery.com/val/

Shanti C 106 Posting Virtuoso

use this line after your alert.

alert("Error:Enter Valid Date");
document.getElementById("num").focus();
return false;

"num" should be your next input filed id.

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

i didn't get you clearly.

Shanti C 106 Posting Virtuoso

you can show the page content based on your query string like:
lets say if page url is like: mypage.php?show=form then:

if($_GET['page']=="form")
{
// showing form
}

if page url is like: mypage.php?show=edit then:

if($_GET['page']=="form")
{
// showing form data
}
else if($_GET['page']=="edit")
{
// showing edit data
}
else
{
// something else
}

if you want to pass two variables at a time,then
url would be : mypage.php?show=edit&editid=9 then you can do like this:

if($_GET['page']=="form")
{
// showing form data
}
else if($_GET['page']=="edit")
{
  $id=$_GET['editid'];
you can use $id to retrieve query or something

}
else
{
// something else
}

and also check this link:
http://www.phpknowhow.com/get-and-post/understanding-get-and-post/

Shanti C 106 Posting Virtuoso

or simply pass this document.signup.elements object to second method.
for clearance chec out the following:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function first_method()
{
	alert(document.test.elements);
	second_method(document.test.elements);
}
function second_method(list)
{
	alert(list.length);
	for(i=0;i<list.length;i++)
	{
		alert(list[i].name+":"+list[i].value);
	}
}
</script>
</head>
<body>
<form name="test" method="post" action="">
<select name="htmlcombo" id="htmlcombo" >
 <option  value="0">Select</option>
    <option  value="1">Text1</option>
    <option  value="2">Text2</option>
    <option  value="3">Text3</option>
</select>
<br>
<input type="text" name="test1">
<br>
<br>
<input type="submit" name="submit" value="Submit" onclick="first_method();"> 

</form>
</body>
</html>