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
Share on other sites

yes that helped now i have another error(sorry i can't tel the difference between [ and ( my computer is hooked to the TV...small fonts do not like me ;) Notice: Undefined index: category in /home/.caicos/arshem/longlive-ps.com/search.php on line 60
Link to comment
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.  ;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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