Page 1 of 1

parsing parameter problem

Posted: Thu Apr 26, 2007 2:21 pm
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

Posted: Thu Apr 26, 2007 3:54 pm
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'];
}
?>

php parsing problem

Posted: Fri Apr 27, 2007 1:21 am
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