I have a query that finds a name, and if a condition exists, it redirects them to one page, if another condition exists, it redirects them to another page...but I am losing the session variable...
I can't pass the variable in the header Location because the variable contains spaces...
so, they select their institution from start.php and then it goes to the below code
<?php
require_once('dbconn.php');
session_start();
$conn = db_connect();
if (!$conn)
return 'Could not connect to database server - please try later.';
$institutionname = $_POST["institutionname"];
$query_payment = "SELECT paidflag, institutionname FROM test_tbl WHERE institutionname = '$institutionname'";
$institutionpayment = mysql_query($query_payment) or die("Problem with the query: $query_payment<br>" . mysql_error());
$row = mysql_fetch_array($institutionpayment);
if (isset($row['paidflag']) && $row['paidflag']=="0") {
header ("Location: https://mysite.com/membership06/memberaffiliateapp.php");
exit;
}
if (isset($row['paidflag']) && $row['paidflag']=="1") {
header ("Location: https://mysite.com/membership06/unpaid.php");
exit;
}
?>
in memberaffiliateapp.php I have
session_start();
$institutionname = $_POST["institutionname"];
it does pass the variable using
https://mysite.com/membership06/memberaffiliateapp.php?institutionname=".$row['institutionname']."");
but, of course with spaces in instututionname I get
U%20of%20Me instead of U of Me
I can't use the primary key as the variable passed as there could be 12 institutions with the same name. I possibly could select distinct and use the primary key...or create a new table of just institutions with no institution repeating...but there has to be a way to pass the variable? I am babbling and trying new things as I type and am getting no where.
Any thoughts are appreciated from the masses here. Coding is not my forte...