| Hallo Forum,
ich bitte euch um Rat und Hilfe. Mein Problem ist, wie kann ich aus URL B2B-Nummer auf allen Seiten anzuzeigen bzw. auszugeben.
URL Beispiel. _http://www.domain.de/index.php?b2b=33 Auf erster Seite "schritt1.php" klappt es gut, aber auf weiteren folgenden Seiten "schritt2.php" und "schritt3.php" klappt es nicht. Was mache ich falsch?
Seite: schritt1.php
<? session_start();
$_SESSION['B2B'] = $_GET['b2b'];
$required = array();
$error_comment = array();
$error_count = 0;
function validEmail($email) {
@ list($local, $domain) = explode("@", @ $email);
$pattern_local = '^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?)\.([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$';
$pattern_domain = '^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?)\.([-]?)[0-9a-z]*([-]?[0-9a-z]+)+)*\.[a-z]{2,4}$';
$match_local = eregi($pattern_local, $local);
$match_domain = eregi($pattern_domain, $domain);
if ($match_local && $match_domain)
return true;
return false;
}
//echo "<pre>";print_r($_POST); echo "</pre>";
if(@$_GET['b2b']!='')$_POST['b2b']=$_GET['b2b'];
if(count(@$_SESSION['schritt1'])>1 AND @$_POST['post_schritt1']=='')$_POST=$_SESSION['schritt1'];
if (@ $_POST['post_schritt1']) {
// process data
if($error_count<1) {
unset($_POST['post_schritt1']);
$_SESSION['schritt1'] = $_POST;
echo "<script>location.href='schritt2.php'</script>";
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Anmeldeformular - Schritt 1</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php print $_GET['b2b']; ?> Zitat:
<?php print $_GET['b2b']; ?>
hier wird B2B-Nummer fehlerfrei angezeigt.
Seite: schritt2.php
<?session_start();
$required = array();
$error_comment = array();
$error_count = 0;
//echo "<pre>";print_r($_POST); echo "</pre>";
//echo "<pre>";print_r($_SESSION); echo "</pre>";
if(count(@$_SESSION['schritt2'])>1 AND @$_POST['post_schritt2']=='')$_POST=$_SESSION['schritt2'];
if (@ $_POST['post_schritt2']) {
// process data
if ($_POST['anfrage_titel'] == '') {
$required['anfrage_titel'] = 1;
$error_count++;
}
if ($_POST['kontakt_bis'] == '') {
$required['kontakt_bis'] = 1;
$error_count++;
}
if ($_POST['beschreibung'] == '') {
$required['beschreibung'] = 1;
$error_count++;
}
if ($_POST['zeit'] == '') {
$required['zeit'] = 1;
$error_count++;
}
if($error_count<1) {
unset($_POST['post_schritt2']);
$_SESSION['schritt2'] = $_POST;
echo "<script>location.href='schritt3.php'</script>";
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Anmeldeformular - Schritt 2</title>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php print $_SESSION['B2B']; ?> Zitat:
<?php print $_SESSION['B2B']; ?>
Warum wird hier keine B2B-Nummer angezeigt?
Mit fruendlichen Grüßen |