Jump to content


Photo

Drop down menu Connected to MYSQL...


  • Please log in to reply
5 replies to this topic

#1 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 02 July 2006 - 11:12 PM

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


<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>";
 		}
		}
	}


#2 Ph0enix

Ph0enix
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 02 July 2006 - 11:23 PM

Where you have

$category = $_GET('category');

Put

$category = $_GET['category'];

Hope this helps!  ;)
[url=http://www.slimphoenix.com][/url]

#3 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 02 July 2006 - 11:29 PM

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

#4 Ph0enix

Ph0enix
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 02 July 2006 - 11:49 PM

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.

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

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.

error_reporting(E_ALL ^ E_NOTICE) ;

Hope this helps.  ;)
[url=http://www.slimphoenix.com][/url]

#5 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 03 July 2006 - 12:06 AM

Works Like a charm now :D thanks sooooo much pheonix :D I appreciate it!

#6 Ph0enix

Ph0enix
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 03 July 2006 - 12:08 AM

No problem!
[url=http://www.slimphoenix.com][/url]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users