Jump to content



Photo

Using $_Get In Chapter 8 - Creating Web Applications


  • Please log in to reply
2 replies to this topic

#1 wadesmart

wadesmart

    Newbie

  • Members
  • Pip
  • 10 posts
  • LocationOklahoma

Posted 26 November 2012 - 6:02 PM

Ive been using what Ive learned this book for a long time now but Im stumped on something.

I have a situation where I can not use a drop down list so I was going to use a links instead.

link: href="index.php?p=performances?performance=Life_After_50"

Im stumped as how to handle this code.

In the index.php page I see the code:


//Validate what page to show
if(isset($_GET['p'])){
$p = $_GET['p'];
} else if( isset($_POST['p'])) { //form
$p = $_POST['p'];
} else {
$p = NULL;
}

But how does the page get redirected back to the performances.inc.php to access the performance variable data Life After 50?
  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4698 posts
  • LocationState College, PA (USA)

Posted 26 November 2012 - 7:13 PM

It needs to be "index.php?p=performances&performance=Life_After_50". The performances.inc.php file can then access $_GET['performance'], which will have a value of "Life_After_50".
  • 1

#3 wadesmart

wadesmart

    Newbie

  • Members
  • Pip
  • 10 posts
  • LocationOklahoma

Posted 26 November 2012 - 7:20 PM

I had just found that missing & right before you posted.

It never fails. I can look for hours and as soon as I ask for help - I see the problem.
But, it still wasnt working so it def helps to spell things correctly HAA

Thanks Larry.
Much appreciated - as usual :D

Wade
  • 0