Page 1 of 1

need help with a script i'm writing please help

Posted: Thu Aug 01, 2002 4:36 pm
by robin1
Hello everybody,
I'm new to php and wrote my own classified script but ran into a problem that i cant seem to resolve.
basically i have the categorys displayed and what i want is to have a visite click on the category and display the available options within the categor after clearing the curent content of the page. i already have the code to display the category info but cann't seem to get the code to run the function..the problem area is the clicking on a category.

http://www.comgen.ca/phptest/mainclas.php

else
{ $info2 = $category1;
$category_num2 = $info_array1[$x][1];
?>
<span class="class1">
<tr>
<td align="right" width="3%" ><img src="bullet.gif"></td>
<td align="left" width="20%"> <FONT SIZE=3><Strong>
<!-- // echo "$info1 ($category_num1)";-->

//PROBLEM AREA
<a href="<?php echo"$PHP_SELF?cat=$info1";?>"> <? echo"$info1 ($category_num1)"; ?></a>

</strong></FONT></td>
<td align="right" width="3%"><img src="bullet.gif"></td>
<td align="left" width="20%"> <FONT SIZE=3><STRONG> <a href="<?PHP echo"$PHP_SELF?cat=$info2";?>"> <?PHP echo "$info2 ($category_num2)"; ?></STRONG></FONT> </td>
</tr> </span><?PHP
$info1="";
$info2="";
}// closing the else statement

the function testone($cat) // code should be displayed in a new screen
{ echo "testone";}
any help you can give me would be greatly appreciated.. its been 2 weeek that i been tring to fix this problem. thanks everybody

what?

Posted: Thu Aug 01, 2002 8:03 pm
by pb2ya
i went there and it seems that the script is werkin fine. ok i dont know if you can run a function directly off a link, but you can make a link activate a case activate a function:

Code: Select all

<a href="?action=function">activate function</a>
<?php
function function($text)
&#123;
        echo $text;
&#125;
if (empty($_GET&#1111;'action']))
&#123;
        $_GET&#1111;'action'] = 0;
&#125;
$action = $_GET&#1111;'action'];
switch($action)
&#123;
case "function":
$yo = "whatever";
function($yo);
break;
&#125;