TP Underground Lounge 07/08
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 31.03.2004, 16:10   #1
TP-Senior
 
Benutzerbild von badeplatz
 
Registriert seit: Jul 2002
Ort: Allgäu
badeplatz macht alles soweit korrekt

Formular-Übergabe


Hallo,

ich habe dieses Kreditkarten Überprüfungsscript. (siehe unten)

Und möchte, wenn die Karte gültig ist, das Formular = die Formularfelder an http://www.muenchen-hotel.de/formula...nchen-hotel.de weitergeben - posten.

Wer kann mir dabei bitte helfen?

DANKE

Thomas

P.S. Beipsiellink: www.badeplatz.de/kreditkarte/kreditkarte2.php



<?
$date=time(); /* get current date */

/* Get this year and this month and put them in variables */
$thisyear=date("Y",$date);
$thismonth=date("m",$date);
/* if the card is void then make the form */
if ($carta==0){
?>
<HTML>
<FORM ACTion="<?echo($PHP_SELF); ?>" method=POST>
<p>Name:
<input name="name" type="text" id="name">
</p>
<p>Card Number:
<input type="text" name="carta" >
<BR>
Expiration date:

<?/* Create month names */?>
<select name="month">
<? for ($j=1;$j!=13;$j++){ ?>
<option value="<?echo($j);?>"><? echo(date("M",3600*24*29*$j));?></option>
<? } ?>

</SELECT>

<?/* create a 5 year list from this year */?>
<SELECT name="year">
<? for ($j=2000;$j!=$thisyear+6;$j++){ ?>
<option value="<?echo($j);?>"><? echo($j);?></option>
<? } ?>
</SELECT>

</p>
<P>
<input type="submit">
</form>
<? }
/* If card number is not void then try to validate it */
if ($carta!=0){

/* if the month of exp is passed,this year, card is expired */
/* Remember that the card will never be a year in the past as the year list */
/* has been created starting from $thisyear (see next)*/

if($month<$thismonth and $year==$thisyear) exit("Card has expired!");
$cclen=strlen($carta);
/* Check card number lenght: must be 15 or 13 or 16 */
if ($cclen!=13 and $cclen!=15 and $cclen!=16) exit("Credit card not valid: check
spelling.");
/* Check if the card has a pair or odd number of digits */
/* the % give the rest of a division, like: 5 divided 2 -> give 1 */
if ($cclen%2==0) {
$p=0; } /* PAIR */
else {$p=2;} /* ODD */

/* Get each number of the card and put it in an array */
for($a=0;$a!=$cclen;$a++){
$X[$a]=substr($carta,$a,1);

}

/* Algorithm Mod10 modificated (by me :-) */
for ($nume=($p/2);$nume!=$cclen-$p;$nume=$nume+2){
$X[$nume]=$X[$nume]*2;
if ($X[$nume]>=10) {
$X1=substr($X[$nume],0,1);
$X2=substr($X[$nume],1,1);
$X[$nume]=substr($X[$nume],0,1)+substr($X[$nume],1,1);
}
}
/* Sums each value of the modificated array */
/* Check the result of the algorithm */
for ($i=0;$i!=$cclen;$i++){
$val=$val+$X[$i];
}
/* Please note: if the second number of the result of algorithm is not 0 */
/* then the card is NOT valid */
if ($val==0) exit("Credit Card not valid: check spelling");
if (substr($val,1,1)!=0){ $valida="not";}
echo ("The card: $carta seems to be: $valida valid");
exit();
}
/* This condition in the case $card contains characters */
exit("Maybe the Card Number inserted contains characters ? Only numbers
please!");
?>
badeplatz ist offline   Mit Zitat antworten


Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > Traum-Dynamik
Formular-Übergabe Formular-Übergabe
« Abfrage von 2 Tabellen | bild-Ausgabedatei passt das hier rein ? »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 10:41 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67