Jump to content

Drop down menu Connected to MYSQL...


lordphate

Recommended Posts

I keep getting the error of Fatal error: Function name must be a string in /home/.caicos/arshem/longlive-ps.com/search.php on line 60


[code] <SCRIPT LANGUAGE="JavaScript">
<!-- This Drop Down Menu was made at www.CodeSpy.com -->

function jumpBox(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

</SCRIPT>
  </head><body> <div id="main">
  <!-- Copy and Paste this code into the BODY of your HTML document -->

<FORM NAME="categories">
<SELECT NAME="categories" size=1 onChange="javascript:jumpBox()">
<OPTION VALUE="">Go to....
<OPTION VALUE="./search?category=movie">Movies
<OPTION VALUE="./search?category=Audio">Audio
<OPTION VALUE="./search?category=WhitePapers">White Papers
<OPTION VALUE="./search?category=hacking">Hacking
<OPTION VALUE="./search?category=Windows">Windows
<OPTION VALUE="./search?category=AllinOnes">All in Ones
<OPTION VALUE="./search?category=Applications">Applications
</SELECT>
<input type=button value="Go!" onClick="javascript:jumpBox(this)">
</FORM>
<?php
$category = $_GET('category');  //Line 60
if($category != "") {
$query  = "SELECT id, name, size, uploader FROM upload WHERE category = '$category'";
$result = mysql_query($query) or die('Error, query failed');
if (mysql_num_rows($result) == 0) {
echo "No Files to Delete...Be the first Uploader! <br>";
} else {
$html = "";
while (list($fileid, $filename, $size, $uploader) = mysql_fetch_array($result)) {
          $html .= "<a href=\"admin.php?id=$fileid\">-$filename-</a><br>";
}
}
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/13502-drop-down-menu-connected-to-mysql/
Share on other sites

This isnt an error, its just a notice, its telling you that this just means that $category = $_GET['category']; doesn't exist. You can check it by using this.

[code]if(isset($_GET['category']))[/code]

Usually your server is set to hide these notices but obviously in your case its not. so just put this into your script directly under <?php and it will hide your notices.

[code]error_reporting(E_ALL ^ E_NOTICE) ;[/code]

Hope this helps.  ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.