parsing parameter problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hishamz
Forum Newbie
Posts: 2
Joined: Thu Apr 26, 2007 2:10 pm

parsing parameter problem

Post by hishamz »

I am not very good in PHP. My problem is : I try to pass parameter from href but it seem not working. Here is my code :


<a href="?f=history/index" class="link_leftmenu" onMouseOver="window.status='History'; return true;" onMouseOut="window.status=''; return true;">History</a><br>&nbsp;<br>

<?
echo "f is $f <br>";
if (!$f) $f = "index";
echo "f is $f";
include("../content/$f.php");
?>

The first echo always return null value which my page cannot refer to ../content/history/index.php

Please help. It was working before and recently it seems not working anymore.

regards,

Ujang
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You're probably learning from an old book or an old tutorial.

try

Code: Select all

<?php
if ( !isset($_GET['f']) ) {
  echo 'get parameter f not set';
}
else {
  echo 'f: ', $_GET['f'];
}
?>
hishamz
Forum Newbie
Posts: 2
Joined: Thu Apr 26, 2007 2:10 pm

php parsing problem

Post by hishamz »

Thank You very much Mr volka.

My problem have been solve.

My website : http://www.rowing.org.my have working as usual.

Thanks also to DevNetwork Forums

regards,

Ujang
Post Reply