Jump to content

$_GET data


williamZanelli

Recommended Posts

Hey guys,

 

I'm trying to use data from my $_GET, for some reason it doesnt seem to get passed, I was wondering if you could see what the problem is.

 

I start off on the  page below, I store the GET varibles in the session,

Depending on some conditions I get redirected to some page.

 


session_start();
$_SESSION['get_data'] = $_GET;

 

When I get redirected, I need to to retrieve the GET vars, I use the following code

 

<?php
session_start();
  $get = $_SESSION['get_data'];
.....
.......
echo("Hello = ". $get['uid']);

 

This returns a blank - I know when I come the first page [see first snipped of code], there's a 'uid' in the URL.

 

What could be wrong with my code?

 

Thanks for your thoughts

 

William

 

 

Link to comment
Share on other sites

The posted code works (assuming that sessions are working on both pages.) Add the following two lines immediately after your <?php tag on both pages -

 

ini_set ("display_errors", "1");
error_reporting(E_ALL);

 

What confuses me is the following line: "I start off on the  page below, I store the GET varibles in the session,"

 

It almost sounds like you didn't even have any GET variables to start off with. Is there a form?

Link to comment
Share on other sites

Hey guys, thanks for the reply.

 

The first page is called Quiz.php

 

when I click through to this page the URL is www.somewebsite.com/quiz/Quiz.php?uid=876876897

 

So I know there's a 'uid' varible that is retrieveable via the GET method. I also use it on the first page (Quiz.php) to do some computation.

 

The control is then passed on to a second page, from which the page redirects to a third page, called,  compute.php [the second snippet of code I posted is compute.php]..

 

I've added code posted by PFMaBiSmAd  to both the pages,

 

ini_set ("display_errors", "1");
error_reporting(E_ALL);

 

I get the following errors

 

Notice: Undefined index: get_data in /home/fhlinux148/......./Quiz/compute.php on line 4

Notice: Undefined index: post_data in /home/fhlinux148/.........../Quiz/compute.php on line 5

 

Any ideas??  ??? ???

 

William

Link to comment
Share on other sites

Ok guys heres, the code for Quiz.php

 

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();

//Database connection stuff
$servername = "xxx";
$username = "xxx";
$password = "xxx";

$con = mysql_connect($servername,$username,$password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("somename", $con);


$sql = "Select * FROM quiz WHERE userID = " . $_GET['uid'];
$result = mysql_query ($sql);

if (mysql_num_rows ($result) > 0){

 $_SESSION['get_data'] = $_GET;
 header("Location: http://www.scorecha.com/Quiz/compute.php");

}else{
//..... some other code 

 

The code on the compute.php is

 

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();
  $get = $_SESSION['get_data'];
  $post = $_SESSION['post_data'];

$servername = "xxx";
$username = "xxx";
$password = "xxx";

$con = mysql_connect($servername,$username,$password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("somedatabase", $con);


//$sql_check_user = "Select * FROM quiz WHERE userID = " . $get['uid'];
//if (isset($get['uid']))
echo("Hello = ". $get['uid']);
{........

 

Thanks for your thoughts.

Link to comment
Share on other sites

Put an exit; statement after your header(); redirect to prevent any remaining code on the page from being executed.

 

For the errors you have posted to occur, the session variables are either not getting set, they are getting overwritten, or you are changing the domain/hostname or path when you redirect and the session cookie settings are not setup to allow the domain/hostname or path to be changeable and match up the sessions (or it is even possible that you have disabled cookies in your browser.)

 

Have you verified that any session works by just setting a session variable on one page and seeing if it exists on the second page without any other logic present?

Link to comment
Share on other sites

Hi PFMaBiSmAd,

 

Thanks for your response,

 

I've added the exit(); statements as requested.

 

I have verified the sessions are working, as in my quiz I have use the post fucntion,

 

Quiz.php
$_SESSION['post_data'] = $_POST;


compute.php

$post = $_SESSION['post_data'];
................

$answer7 = $post['Q7'];
echo ("<br/> Asnwer 7 = " . $answer7);

 

I closed down my browser and restrated, it started working as I wanted it! A little tempremental though.. some times I get weird 'uid''s  that I entered previously.

 

I'm using FF2 for anyone who's interested.

 

Thanks for the pointers.

Link to comment
Share on other sites

Since register_globals are off, they are not what is responsible for overwriting your variables.

 

Either your form/links are incorrect or the part of your code that you did not bother to post is overwriting them or not even setting them.

 

You are getting error messages that both get_data and and post_data are undefined in compute.php on line 4 and 5, but you are also stating that post_data is working. It cannot be both at the same time. And for the part of the code you did post, you should be getting an error that post_data is undefined if on the first visit your code executes the if() conditional branch shown.

 

So, your code obviously reaches the compute.php page through more ways than where the GET variables are copied into $_SESSION['get_data']. Something in the part of your code you did not show is causing the problem.

 

Again, to get help with what your code is doing you are going to need to post it.

Link to comment
Share on other sites

Hey guys, thanks for the replies.

 

I've noticed something, if I used IE7, I get the desired result, if I use FireFox 2 - I get an error on the following code, this code is in a file called 6.php (see below) - specifcally the isset condition fails using FF2, and not so when I use IE7.

 

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();

if (isset($_SESSION['uid'])){
  $user = $_SESSION['uid'];
}
else{
$user = '11111';
}
  

 

 

I've made numerous changes since I posted the last bits of code, heres, the full code.

 

Control is passed from external link.. with a URL such as http://mywebsite.com/Quiz/Quiz.php?uid=821263384718001

 

Quiz.php

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();


//Database connection stuff
$servername = "XXX";
$username = "XXX";
$password = "XXX";

$message1 ='';
$message2 ='';
$message3 ='';
$message4 ='';
$message5 ='';
$message6 ='';
$message7 ='';
$message8 ='';
$message9 ='';
$message10 ='';
$message11 ='';
$message12 ='';
$q1_array=array("", "", "", "");
$q2_array=array("", "", "", "");
$q3_array=array("", "", "", "");
$q4_array=array("", "", "", "");
$q5_array=array("", "", "", "");
$q6_array=array("", "", "", "");
$q7_array=array("", "", "", ""); 
$q8_array=array("", "", "", "");
$q9_array=array("", "", "", "");
$q10_array=array("", "", "", "");
$q11_array=array("", "", "", "");
$q12_array=array("", "", "", "");

$con = mysql_connect($servername,$username,$password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("dbname", $con);
////////////////////

//check if user alread exists
if (!(isset($_GET['uid']))){

if (!(isset($_SESSION['uid']))){
//no userID
$uid = 0;
}else{
$uid = $_SESSION['uid'];
}


}
else{
$uid = $_GET['uid'];
$_SESSION['uid'] = $uid;
}

echo("UID on quiz page = " . $uid);

$sql = "Select * FROM quiz WHERE userID = '" . $uid. "'";
$result = mysql_query ($sql);

//if (isset($_GET['uid'])){

if (mysql_num_rows ($result) > 0){

 //$_SESSION['get_data'] = $_GET;
 header("Location: http://www.mywebsite.com/Quiz/compute.php");
 exit();

}else{

$flag = true;
if(isset($_POST['submit'])){

     if($_POST['Q1'] == ''){
          $message1 = 'Please select a value for this question';
	  
	  $flag = false;
     }
 else{

 $q1_array[$_POST['Q1']] = 'checked';
 }
     if($_POST['Q2'] == ''){
          $message2 = 'Please select a value for this question';
	  $flag = false;
     }
 	 else{

 $q2_array[$_POST['Q2']] = 'checked';

	 	 }
  if($_POST['Q3'] == ''){
          $message3 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

  
 $q3_array[$_POST['Q3']] = 'checked';
 }

  if($_POST['Q4'] == ''){
          $message4 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

 $q4_array[$_POST['Q4']] = 'checked';

	 	 }

  if($_POST['Q5'] == ''){
          $message5 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{


 $q5_array[$_POST['Q5']] = 'checked';

	 }

  if($_POST['Q6'] == ''){
          $message6 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

 $q6_array[$_POST['Q6']] = 'checked';
 }

  if($_POST['Q7'] == ''){
          $message7 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

 $q7_array[$_POST['Q7']] = 'checked';
 }

  if($_POST['Q8'] == ''){
          $message8 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

 $q8_array[$_POST['Q8']] = 'checked';
 }


  if($_POST['Q9'] == ''){
          $message9 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

 $q9_array[$_POST['Q9']] = 'checked';
 }

  if($_POST['Q10'] == ''){
          $message10 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{

 $q10_array[$_POST['Q10']] = 'checked';
 }
  
  if($_POST['Q11'] == ''){
          $message11 = 'Please select a value for this question';
    $flag = false;
 }	 else{

 $q11_array[$_POST['Q11']] = 'checked';
 }
  
  if($_POST['Q12'] == ''){
          $message12 = 'Please select a value for this question';
     $flag = false;
 }
 	 else{
 			  
 $q12_array[$_POST['Q12']] = 'checked';
 }

 if ($flag){
 //redirect to 
  $_SESSION['post_data'] = $_POST;
  
 header("Location: http://www.mywebsite.com/Quiz/computer1.php");
 exit();
 }//closes if flag
}
}//close outer else

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>| Quiz</title>
</head>

<body>
<p> </p>

</p>
<ol>
<form action="Quiz.php" method="post" name="radio_form">

<font color="#FF0000"> <?PHP if (!($flag)){ print('Please provide answers for all the questions indicated.'); };   ?>  </font>
<br/>
<font color="#FF0000"> <?PHP print($message1);   ?>  </font>

<br/><li>Question 1 is...</li>
<p><input type="radio" name="Q1" value = "0" <?PHP print($q1_array[0]);   ?>  />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q1" value = "1"  <?PHP print($q1_array[1]);   ?>/>     Answer b - one possible answer <br />
   <input type="radio" name="Q1" value = "2"  <?PHP print($q1_array[2]);   ?>/>     Answer c - one possible answer<br />
   <input type="radio" name="Q1" value = "3"  <?PHP print($q1_array[3]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message2);   ?>  </font>
  <br/><li>Question 2 is...</li>
<p><input type="radio" name="Q2" value = "0"   <?PHP print($q2_array[0]);   ?> />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q2" value = "1"  <?PHP print($q2_array[1]);   ?>  />     Answer b - one possible answer <br />
   <input type="radio" name="Q2" value = "2"  <?PHP print($q2_array[2]);   ?> />     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message3);   ?>  </font>
    <br/><li>Question 3 is...</li>
<p><input type="radio" name="Q3" value = "0"   <?PHP print($q3_array[0]);   ?>/>    Answer a - one possible answer <br /> 
    <input type="radio" name="Q3" value = "1"  <?PHP print($q3_array[1]);   ?>  />     Answer b - one possible answer <br />
   <input type="radio" name="Q3" value = "2"  <?PHP print($q3_array[2]);   ?> />     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message4);   ?>  </font>
   <br/><li>Question 4 is...</li>
<p><input type="radio" name="Q4" value = "0"  <?PHP print($q4_array[0]);   ?> />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q4" value = "1"  <?PHP print($q4_array[1]);   ?> />     Answer b - one possible answer <br />
   <input type="radio" name="Q4" value = "2"   <?PHP print($q4_array[2]);   ?> />     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message5);   ?>  </font>
   <br/><li>Question 5 is...</li>
<p><input type="radio" name="Q5" value = "0"   <?PHP print($q5_array[0]);   ?>/>    Answer a - one possible answer <br /> 
    <input type="radio" name="Q5" value = "1"  <?PHP print($q5_array[1]);   ?> />     Answer b - one possible answer <br />
   <input type="radio" name="Q5" value = "2"   <?PHP print($q5_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message6);   ?>  </font>
   <br/><li>Question 6 is...</li>
<p><input type="radio" name="Q6" value = "0"   <?PHP print($q6_array[0]);   ?>/>    Answer a - one possible answer <br /> 
    <input type="radio" name="Q6" value = "1"  <?PHP print($q6_array[1]);   ?> />     Answer b - one possible answer <br />
   <input type="radio" name="Q6" value = "2"   <?PHP print($q6_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message7);   ?>  </font>
   <br/><li>Question 7 is...</li>
<p><input type="radio" name="Q7" value = "0"  <?PHP print($q7_array[0]);   ?> />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q7" value = "1"  <?PHP print($q7_array[1]);   ?> />     Answer b - one possible answer <br />
   <input type="radio" name="Q7" value = "2"   <?PHP print($q7_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message8);   ?>  </font>
   <br/><li>Question 8 is...</li>
<p><input type="radio" name="Q8" value = "0"   <?PHP print($q8_array[0]);   ?>/>    Answer a - one possible answer <br /> 
    <input type="radio" name="Q8" value = "1"  <?PHP print($q8_array[1]);   ?> />     Answer b - one possible answer <br />
   <input type="radio" name="Q8" value = "2"   <?PHP print($q8_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message9);   ?>  </font>
   <br/><li>Question 9 is...</li>
<p><input type="radio" name="Q9" value = "0"  <?PHP print($q9_array[0]);   ?> />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q9" value = "1"   <?PHP print($q9_array[1]);   ?>/>     Answer b - one possible answer <br />
   <input type="radio" name="Q9" value = "2"   <?PHP print($q9_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message10);   ?>  </font>
   <br/><li>Question 10 is...</li>
<p><input type="radio" name="Q10" value = "0"  <?PHP print($q10_array[0]);   ?> />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q10" value = "1"   <?PHP print($q10_array[1]);   ?> />     Answer b - one possible answer <br />
   <input type="radio" name="Q10" value = "2"   <?PHP print($q10_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message11);   ?>  </font>
   <br/><li>Question 11 is...</li>
<p><input type="radio" name="Q11" value = "0"   <?PHP print($q11_array[0]);   ?>/>    Answer a - one possible answer <br /> 
    <input type="radio" name="Q11" value = "1"   <?PHP print($q11_array[1]);   ?>/>     Answer b - one possible answer <br />
   <input type="radio" name="Q11" value = "2"   <?PHP print($q11_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<font color="#FF0000"> <?PHP print($message12);   ?>  </font>
   <br/><li>Question 12 is...</li>
<p><input type="radio" name="Q12" value = "0"  <?PHP print($q12_array[0]);   ?> />    Answer a - one possible answer <br /> 
    <input type="radio" name="Q12" value = "1"   <?PHP print($q12_array[1]);   ?>/>     Answer b - one possible answer <br />
   <input type="radio" name="Q12" value = "2"   <?PHP print($q12_array[2]);   ?>/>     Answer c - one possible answer<br />
</p>
<br/>

<input type="submit" name="submit" value="Submit.." />
  </form>
</ol>
</body>

</html>

 

From here contol is passed on to compute1.php or Computer.php

 

Computer1.php

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL);

//session_start();
  //$_SESSION['post_data'] = $_POST;
  ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>
<body>

<a href="http://news.bbc.co.uk" target="_blank" ><img src="http://mywebsite.com/Quiz/ad.jpg"/></a>

<br/>
<br/>
<br/>

<?php

echo ("This is some middle page containing an ad..");


?>
<br/>

<p><a href="http://mywebsite.com/Quiz/compute.php">Click</a> here to recieve your results. </p>

</body>
</html>

 

Compute.php is

 

<?php  ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();
  $get = $_SESSION['get_data'];
  $post = $_SESSION['post_data'];
  $user = $_SESSION['uid'];



//Database connection stuff
$servername = "xxx";
$username = "xxx";
$password = "xxx";
$page = 6;
$iq = 100;

$con = mysql_connect($servername,$username,$password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("dbname", $con);
////////////////////

//$sql_check_user = "Select * FROM quiz WHERE userID = " . $get['uid'];

echo("::: UID = ". $user);

$uid = $user;

$answer1 = $post['Q1'];
echo ("Asnwer 1 = " . $answer1);
$answer2 = $post['Q2'];
echo ("<br/> Asnwer 1 = " . $answer2);
$answer3 = $post['Q3'];
echo ("<br/> Asnwer 1 = " . $answer3);
$answer4 = $post['Q4'];
echo ("<br/> Asnwer 1 = " . $answer4);
$answer5 = $post['Q5'];
echo ("<br/> Asnwer 1 = " . $answer5);
$answer6 = $post['Q6'];
echo ("<br/> Asnwer 1 = " . $answer6);
$answer7 = $post['Q7'];
echo ("<br/> Asnwer 1 = " . $answer7);
$answer8 = $post['Q8'];
echo ("<br/> Asnwer 1 = " . $answer8);
$answer9 = $post['Q9'];
echo ("<br/> Asnwer 1 = " . $answer9);
$answer10 = $post['Q10'];
echo ("<br/> Asnwer 1 = " . $answer10);
$answer11 = $post['Q11'];
echo ("<br/> Asnwer 1 = " . $answer11);
$answer12 = $post['Q12'];
echo ("<br/> Asnwer 1 = " . $answer12);



$score = $answer1 + $answer2  + $answer3 + $answer4 + $answer5+ $answer6+ $answer7+ $answer8+ $answer9 +  $answer10 + $answer11 + $answer12;

$array_1 = array("1", "2", "3", "4", "5", "6", "7");
$array_2 = array("8", "9", "10",  "11", "12", "13", "14", "15", "16");
$array_3 = array("17", "18", "19", "20", "21");


//do some calculation and work out page to set user
//CHNAGE DEPENDING ON QUESTIONS


if ($score >=0 && $score <13){
$iq = 100 -((13 - $score) * 2 ); 
$image = chooseImage($array_1);
$page = $array_1[$image];

}
elseif($score >= 13 && $score < 30){
$iq = (($score-13) * 2 ) + 104; 
$image = chooseImage($array_2);
$page = $array_2[$image];
}
elseif($score >= 33 && $score < 36){
$iq = (($score-13) * 2 ) + 107; 
$image = chooseImage($array_3);
$page = $array_3[$image];


}


echo ("Answers = :" . $answer1 . " + " .$answer2);
echo ("<br/> <br/> Score = " . $score . "<br/><br/>");
echo ("Q1 " . $post['Q1']);
echo ("Q2 " . $post['Q2']);
echo ("Q3 " . $post['Q3']);
echo ("Q4 " . $post['Q4']);

$answers_array = array ("Q1" => $post['Q1'], "Q2" => $post['Q2'], "Q3" => $post['Q3'], "Q4" => $post['Q4'], "Q5" => $post['Q5'], "Q6" => $post['Q6'], "Q7" => $post['Q7'], "Q8" => $post['Q8'], "Q9" => $post['Q9'], "Q10" => $post['Q10'], "Q11" => $post['Q11'], "Q12" => $post['Q12']);

$answers = serialize($answers_array);
echo("<br/> <br/>");
print_r($answers);

$sql_insert = "INSERT INTO quiz (userID, score, page, IQ, answers)
VALUES ('$uid', $score, $page, $iq, '$answers')";
mysql_query ($sql_insert);

echo ("<br/> <br/> inserted data into DB, UID= '$uid' <br/> Error = " . mysql_error());
//

header("Location: http://www.scorecha.com/Quiz/results/6.php");
exit();

//redirect now to 

//}//close else

function chooseImage ($array_no){

$arraySize = sizeof($array_no);
$displayPage = rand (0, $arraySize-1);
return $displayPage;

}

//Do not change below this.
mysql_close($con);
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>

 

Control gets redirected again to a file called 6.php

 

<?php ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();

//PROBLEM WITH THIS IF STATMENT OCCURS, DEPENDING ON IE7 OR FF2

if (isset($_SESSION['uid'])){
  $user = $_SESSION['uid'];
}
else{
$user = '11111';
}
echo("UID on 6.php =" . $user);





//Database connection stuff
$servername = "xxx";
$username = "xxx";
$password = "xxx";
$image = 6;
$iq = 100;

$con = mysql_connect($servername,$username,$password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("scorechac2", $con);
////////////////////

$sql = "Select * from quiz where userID = '" . $user ."'";

$result = mysql_query ($sql);
while ($row = mysql_fetch_array ($result)){
//  return $row[$select];
$iq = $row['IQ'];
$image = $row ['page'];
} 

//array

$_1_quote = array("name" => "x", "quote" => "someQuote");
$_2_quote = array("name" => "x", "quote" => "someQuote");
$_3_quote = array("name" => "x", "quote" => "someQuote");
$_4_quote = array("name" => "x", "quote" => "someQuote");
$_5_quote = array("name" => "x", "quote" => "someQuote");
$_6_quote = array("name" => "x", "quote" => "someQuote");
$_7_quote = array("name" => "x", "quote" => "someQuote");
$_8_quote = array("name" => "x", "quote" => "someQuote");
$_9_quote = array("name" => "x", "quote" => "someQuote");
$_10_quote = array("name" => "x", "quote" => "someQuote");
$_11_quote = array("name" => "x", "quote" => "someQuote");
$_12_quote = array("name" => "x", "quote" => "someQuote");
$_13_quote = array("name" => "x", "quote" => "someQuote");
$_14_quote = array("name" => "x", "quote" => "someQuote");
$_15_quote = array("name" => "x", "quote" => "someQuote");
$_16_quote = array("name" => "x", "quote" => "someQuote");
$_17_quote = array("name" => "x", "quote" => "someQuote");
$_18_quote = array("name" => "x", "quote" => "someQuote");
$_19_quote = array("name" => "x", "quote" => "someQuote");
$_20_quote = array("name" => "x", "quote" => "someQuote");
$_21_quote = array("name" => "x", "quote" => "someQuote");

$arrayName = "_". $image . "_quote";



?>
  


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

</head>

<body>




<p> Your MQ is <?php print($iq); ?>
<img src="<?php print($image); ?> " />
<p>Quote <?php $arrayName["quote"] ?>
<p>Quote <?php $arrayName["name"] ?>

</body>
</html>

 

Thanks in advance for your thoughst

Link to comment
Share on other sites

Ok boys, I;ve nailed this beast of a problem!!

 

What I know is, in FireFox, http://mywebsite.com is NOT the same as http://www.mywebsite.com - Notice the "www"

 

In IE 7 they dont differntiate between the two URL's - or so my experience tells me!!

 

So in FF2, if you're passing data from page to page via header, so if the forwading page, as in the page you start from, has a URL http://www.mywebsite.com/page1.php and you forwward using the following code

 

header("Location: http://mywebsite.com/page2.php");

 

You'll end up loosing the session variables!! Thats what my problem was!!

 

;D ;D

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.