Current location: Hot Scripts Forums » Programming Languages » PHP » FLASH, PHP and JAVASCRIPT


FLASH, PHP and JAVASCRIPT

Reply
  #1 (permalink)  
Old 06-29-06, 03:58 PM
woyrz's Avatar
woyrz woyrz is offline
Newbie Coder
 
Join Date: Dec 2003
Location: montreal
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow FLASH, PHP and JAVASCRIPT

Hi,
im working on a Flash form. I want the flash form callin all the code you see bellow. My big problem in the code is not what php do but what JavaScript do. I want at a certain point to be able to create a form sending it to a anthor server using a post.

but its look like since the page is not send to a browser the function never start


here is my JavaScript code:
Code:
<script language="JavaScript" type="text/javascript" runat="server">
document.abonnement.submit();
</script>
PHP Code:

<?

include("connect_commerce.inc.php");
// 0 => flash 1=> Mysql 3=> Maestro
$namField = array(
array(
"userName""nom_utilisateur"),
array(
"pass""mot_de_passe"),
array(
"accessLevel","niveau_acces"),
array(
"passConf"),
array(
"lastName","nom","nom"),
array(
"firsthName","prenom","prenom"),
array(
"eMail","courriel","courriel"),
array(
"state","province"),
array(
"country","pays"),
array(
"answer","answer"),
array(
"comp","compagnie"),
array(
"title","titre"),
array(
"city","ville"),
array(
"langue""langue""langue"),
array(
"sexe","sexe","sexe"),
array(
"question","question"),
array(
"acceptCondi","accepte_conditions"),
array(
"accRecevoir","accepte_promotions","optin"),
array(
"negoInte","25","25"),
array(
"negoIndexes","27","27"),
array(
"backOfficeFutures","29","29"),
array(
"backOfficeOptions","31","31"),
array(
"technologie","33","33"),
array(
"regularation","35","35"),
array(
"press","1","1"),
array(
"news","5","5"),
array(
"newOptions","11","11"),
array(
"review","13","13"),
array(
"weeklyReview","9","9"),
array(
"trainning","23","23"),

);
//soustraire un au nombre car le array commence a 0
$numOfSecu=2;
$startSecu=0;
$numOfInfo=13;
$startInfo=4;
$numOfEnvoi=12;
$startEnvoi 18;
/*
"no_securite",
"adresse1",
"adresse2",
"telephone",
"telecopieur",
"code_postal",
"nbr_requete",
"age",
"education",
"profession",
"utilisation",
"date_creation",
"date_modification",
"type_carte_credit",
"no_carte_credit",
"titulaire",
"date_expiration",
"no_authorisation",
"message_firepay",
"cout",
"date_facturation "*/

function get_hex_id (){
            
// Cette fonction renvoie un identifiant unique pour les membres.
            
$micro substr(microtime(),2,6) ;
            
$concat time() . $micro ;
            
$dec_1 substr($concat,0,8) ;
            
$dec_2 substr($concat,8,8) ;
            
$hex_1 dechex($dec_1) ;
            
$hex_2 dechex($dec_2) ;
            
$id $hex_1  $hex_2 ;
            return 
$id ;
        }
if(
$_POST){
$noSecurite get_hex_id ();
    
$SqlNameField "`no_securite` ";
    
$sqlDataField " '$noSecurite'"
    
$noArr $startInfo;
    for(
$i=0;$i<=$numOfInfo;++$i){
    
$SqlNameField .= ",`".$namField[$noArr][1]."` ";
    
$sqlDataField .= " ,'".$_POST[$namField[$noArr][0]]."'"
    ++
$noArr;
    }
$sqlMembres "INSERT INTO `membres` (".$SqlNameField.") 
VALUES ("
.$sqlDataField.");";

mysql_query($sqlMembres)or die (mysql_error());
$userName$_POST['userName'];
$userPass$_POST['pass'];
$sqlSecu "INSERT INTO `securite` (`no_securite` , `nom_utilisateur` , `mot_de_passe` , `niveau_acces` ) 
VALUES ('
$noSecurite', '$userName','$userPass',4);";
mysql_query($sqlSecu)or die(mysql_error());
$noArr $startEnvoi;
    for(
$i=0;$i<=$numOfEnvoi;++$i){
        if(
$_POST[$namField[$noArr][0]] == "true"){
            if(
$sqlNoList!=""){
            
$virg ",";        
            }
        
$sqlNoList .=$virg."('$noSecurite', '".$namField[$noArr][1]."')";
        
        }
        ++
$noArr;
    }
    if(
$sqlNoList!=""){
    
$sqlList "INSERT INTO `listes_envoi_enr` (`no_securite` , `no_liste` ) 
    VALUES "
.$sqlNoList.";";
    echo 
$sqlList;
    
mysql_query($sqlList)or die(mysql_error());
    }
?>
<form name="abonnement" method="post" action="<? echo($post);?>">

        <INPUT type="hidden" name="accessCode" value="<? echo($access_code_live);?>">
        <INPUT type="hidden" name="command" value="addProfile">
        <INPUT type="hidden" name="successUrl" value="http://www.m-x.ca">
        <INPUT type="hidden" name="errorUrl" value="http://www.m-x.ca">
        <INPUT type="hidden" name="courriel" value="<?= $_POST['eMail'];?>">
        <INPUT type="hidden" name="sexe" value="<? if($_POST['sexe']==0){echo "M.";}else{echo "Mr.";}?>">
        <INPUT type="hidden" name="nom" value="<?=$_POST['lastName'] ;?>">
        <INPUT type="hidden" name="prenom" value="<?= $_POST['firsthName'];?>">
        <INPUT type="hidden" name="langue" value="FR">
        <INPUT type="hidden" name="optin" value="<? if($_POST['accRecevoir']=="true"){echo "YES"; }else{ echo "NO";};?>">
        <INPUT type="hidden" name="bd" value="MX">
        <INPUT type="hidden" name="categorie" value="RE">    
        <?
        $noArr 
$startEnvoi;
        for(
$i=0;$i<=$numOfEnvoi;++$i){
        if(
$_POST[$namField[$noArr][0]] == "true"){
        
$action="YES";
        }else{
        
$action="NO";
        }
        
?>
        <INPUT type="hidden" name="envoi_<?=$namField[$noArr][1]?>" value="<?=$action;?>">
        <?
        
++$noArr;
        }
        
?>
            </form>
            <script language="JavaScript" type="text/javascript" runat="server">
            document.abonnement.submit();
            </script>
<?
include "smtp_mail.php";
    
$to=$_POST['eMail'];    
    
$subject="Votre inscription au site de Bourse";
    
$from=addslashes"webdev@m-x.ca" );
    
$titleFrom=addslashes("Bourse de Montréal");
    
    
$headers "MIME-Version: 1.0\r\n".
                         
"Content-type: text/html; charset=iso-8859-1\r\n".
                         
"From: ".$titleFrom.", ".$from."\r\n".
                         
"To: <".$to.">\r\n".
                         
"Date: ".date("r")."\r\n".
                         
"Subject: ".$subject."\r\n";

$msg "Nous confirmons votre inscription au site de la Bourse de Montréal.<br />
<br />
Nom d’usager : "
.$_POST['userName']."<br />
Mot de passe : "
.$_POST['pass']."<br />
<br />
Pour créer votre liste des options pour un accès plus rapide aux cotes, cliquez sur Ma liste d’options.<br />
<br />
Pour modifier votre profil d’usager, vous devez vous connecter au site et cliquer sur votre nom d’usager.<br />
<br />
Pour toutes questions concernant la gestion de votre profil, écrivez-nous à <a href=\"mailto:webdev@m-x.ca\">webdev@m-x.ca</a>.<br />"
;

 
$response smtp_mail($to$subject$msg$from$headers);
 
}

?>

Last edited by Christian; 06-29-06 at 04:53 PM.
Reply With Quote
  #2 (permalink)  
Old 06-29-06, 05:31 PM
woyrz's Avatar
woyrz woyrz is offline
Newbie Coder
 
Join Date: Dec 2003
Location: montreal
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
forget it guys i found a anthor way around
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Javascript Variable to PHP watadude PHP 4 01-15-11 06:44 PM
How Can I output Flash Using Javascript in a PHP file? BrandonB PHP 0 10-18-05 11:35 PM
JavaScript with PHP phplearner PHP 2 07-16-05 11:46 AM
Include PHP via javascript bkbenson JavaScript 4 02-19-05 12:40 AM
javascript multiple select menu for php? isaacmlee JavaScript 1 10-15-04 09:53 AM


All times are GMT -5. The time now is 07:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.