assuming that the user goes from register.php to pay.php you can add a hidden input on your pay.php page that has the newly created sql insert.
If I'm understanding the flow correctly
So you would be looking at something like:
register.php
<form name="pay.php" action="pay.php" method="post">
<input type='text' name='C1FirstName' id='firstName' placeholder='FirstName' maxlength='30' tabIndex='1'>
<input type='text' name='C1NameOfTheSchool' id='school' placeholder='Name of the School' maxlength='30' tabIndex='2'>
<input type="text" name="EmailAddress" placeholder="eg:mail@mail.com" tabindex="3"/></td>
<input type='submit' value='Register' class="button" tabIndex='4'/>
</form>
Changes: changed form action and went directly to pay.php
pay.php
<?php
session_start();
include 'mysql-connect.php';
$C1FirstName = $_POST['C1FirstName'];
$C1NameOfTheSchool = $_POST['C1NameOfTheSchool'];
$C1RandomPassword =substr(md5(rand().rand()), 0, 8);
$EmailAddress = $_POST['EmailAddress'];
$_SESSION['PassVar1']= $C1RandomPassword;
$_SESSION['EmailAddress']=$EmailAddress;
$sql="INSERT INTO mozhi(FirstName,NameOfTheSchool,RandomPassword,EmailAddress)VALUES('$C1FirstName','$C1NameOfTheSchool','$C1RandomPassword','$EmailAddress');
$result = mysql_query($sql,$link_identifier);
$id = mysql_insert_id($link_identifier);
?>
<form name="button.php" action="mail.php" method="post">
<input type="checkbox" name="Banking" onClick="showThis('DC', this)">Debit Card
<input type="text" name="CardHolderName" value=""/>
<input type="Submit" name="Pay" value="Pay" onclick="paydb.php"/>
<input type="button" name="Cancel" value="Cancel"/>
<input type="hidden" name="id" value="<?=$id?>">
</form>
Changes:
1, Combined register.php AND pay.php
2, used mysql_insert_id to retrieve the id of the newly created row
3, added the id to a hidden input to retrieve on next page
mail.php
$id = $_POST['id'];
$result = mysql_query("SELECT * FROM mozhi WHERE id='$id' LIMIT 1");
$result = mysql_fetch_assoc($result);
$myPassVar = $result['password'];
$myEmailVar = $result['email'];
$mail->MsgHTML($myPassVar);
$mail->AddAddress($myEmailVar);
Changes: Retrieved information from database based on ID
I fudged some of the variable names so this code won't work 'as is'..
Additionally there are many approaches that you can take based off this model
a, if your uncomfortable about using id in the hidden input then you might save it in a session
b, if your not using id then you could remain to use the email,password sessions your using
This is just one of the approaches that could be used.
Hope this helps!!