any got any ideas why this passes the second variable blank????? header('location: admin_home.php?tournament_id='.urlencode($tournament_id).'&color='.urlencode($color)); exit; PHP: first variable passes even if I switch the order. Meaning color=X shows if i make it first.
Try: $url = 'admin_home.php?tournament_id=' . urlencode($tournament_id) . '&color=' . urlencode($color); header("Location: {$url}"); exit; PHP:
<?php include('db_config.php'); $username = isset($_REQUEST['txtUser'])?$_REQUEST['txtUser']:''; $password = isset($_REQUEST['txtPass'])?$_REQUEST['txtPass']:''; $salt = 's+(_a*'; $password = md5($password.$salt); $password = substr($password, 0, 10); $tournament_id=$_POST['tournament_id']; $url = 'admin_home.php?tournament_id=' . $admin_id . '&color=' . $color; $sql1 = "SELECT * FROM `tournament` where `color` = `$color` and `tournament_id` = `$tournament_id`"; $query1 = mysql_query($sql1); $sql = "SELECT * FROM `admin` where username='$username' and password='$password'"; $query = mysql_query($sql); $row = mysql_fetch_array($query); $adminid=$row['admin_id']; if(($adminid>0)) { $_SESSION['logged']=true; $_SESSION['admin_id']=$username; $_SESSION['id']=$adminid; header("Location: {$url}"); exit; } header('location:index.php?msg=Invalid admin login details'); ?> PHP: If you really think you can help me, I cant figure out why its not storing $color. All the DB info is correct and does exist. the color pulls from tournament. row is called 'color'
I'm not seeing where you've defined $color. I see you define $tournament_id from $_POST['tournament_id']. Is the value for $color in the $_POST? $color = $_POST['color']; maybe?
<?php include('db_config.php'); $username = isset($_REQUEST['txtUser'])?$_REQUEST['txtUser']:''; $password = isset($_REQUEST['txtPass'])?$_REQUEST['txtPass']:''; $salt = 's+(_a*'; $password = md5($password.$salt); $password = substr($password, 0, 10); $tournament_id=$_POST['tournament_id']; $color=$_POST['color']; $sql = "SELECT * FROM `admin` where username='$username' and password='$password'"; $query = mysql_query($sql); $row = mysql_fetch_array($query); $adminid=$row['admin_id']; if(($adminid>0)) { $_SESSION['logged']=true; $_SESSION['admin_id']=$username; $_SESSION['id']=$adminid; header('location: http://www..com/Admin/admin_home.php?tournament_id='.urlencode($tournament_id).'&color='.urlencode($tournament_id)); exit; } header('location:index.php?msg=Invalid admin login details'); ?> PHP: does not pass a second value url comes up blank for second value
Where is your "color" value coming from? Do you pull it from a form? Do you pull it from a database? Do you hard code it? You're trying to use the value for $color, but it's not defined anywhere. If you define it as $color = $_POST['color'] but you haven't submitted a form or something that adds "color" to the post variable, you will still get an empty value. Where do you GET the color from?
header('location: http://www..com/Admin/admin_home.php?tournament_id='.urlencode($tournament_id).'&color='.urlencode($tournament_id)); exit; PHP: passes it as admin_home.php?tournament_id=15&color= when im showing the same variable
Is the color stored in the database? If it is, maybe you should replace $color=$_POST['color']; with $color=$row['color']; after: $row = mysql_fetch_array($query);
Now im up to this <?php include('../Admin/db_config.php'); $tournament_id=$_REQUEST['tournament_id']; $username = isset($_REQUEST['txtUser'])?$_REQUEST['txtUser']:''; $password = isset($_REQUEST['txtPass'])?$_REQUEST['txtPass']:''; $sql = "SELECT color FROM `tournament` "; $query1 = mysql_query($sql); $row2 = mysql_fetch_array($query1); $sql = "SELECT * FROM `team_registration` "; $query = mysql_query($sql); while($row = mysql_fetch_array($query)){ if(($row['user_id'] == $username) && ($row['password'] == $password)) { $_SESSION['logged']=true; $_SESSION['user_id']=$username; $_SESSION['team_registration_id']=$row['team_registration_id']; header('location:team_manager_home.php?tournament_id='.$row['tournament_id'].'&color='.$row2['color']); exit; } }//while header('location:index.php?tournament_id='.$tournament_id.'&color='.$color); ?> PHP: and for the $color. it is pulling the very first column of that row, not the one corresponding with the correct value. Now both Variables are passed to the Header URL. Only problem now is, It is using the first row of that table. $sql = "SELECT color FROM `tournament` "; $sql['color'] retuns the first row not the correct row