Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
hinksta
Worker
Worker



Joined: Dec 23, 2005
Posts: 226
Location: UK

PostPosted: Wed Nov 29, 2006 1:37 pm Reply with quote

I've made a database search programe and I'm trying to get it to work as a nuke module.
So far it loads ok but when I do a search it returns Sorry, that module file was not found.

here's the search: action=\"modules.php?name=MySearch\"

if i hover over the search btn i see: modules.php?name=MySearch

but the returned link is: modules.php?search=searchterm

it should be: modules.php?name=MySearch&search=searchterm
 
View user's profile Send private message Visit poster's website
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Wed Nov 29, 2006 1:45 pm Reply with quote

It would probably be easier if you posted the code for your button. But maybe this will help: there is a search button in the anagram theme.php (we were debugging it for RN2.10 yesterday). Look in the themeheader function for it and you should be able to clone something that works from it.
 
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Nov 29, 2006 1:52 pm Reply with quote

Make sure the form uses POST and not GET

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
hinksta







PostPosted: Wed Nov 29, 2006 2:07 pm Reply with quote

that was fast, thanks it was the GET, saw it in anagram theme.php, the search is now working.

For my next problem, It has a paging system that also has the same error and i'm guessing it's the GET again. Any clues

Code:
if(isset($_GET['page']))

{
$pageNum = $_GET['page'];
}
if(isset($_GET['search']))
{
$search = $_GET['search'];
}
 
fkelly







PostPosted: Wed Nov 29, 2006 2:31 pm Reply with quote

The first search button in anagram was a post and it worked. Historically the second one (which was intended for topics) was a get and it never worked. Until you see RN2.10 that is. If you are doing a $_GET as in your code that won't work. If you pass 'page' via a POST then you'll need to a $_POST['page'] and likewise for the search.
 
hinksta







PostPosted: Wed Nov 29, 2006 2:35 pm Reply with quote

I changed it to this but makes no difference
Code:
if(isset($_POST["page"])) {

      $pageNum = ($_POST["page"]);
}
if(isset($_POST["search"])) {
      $search = ($_POST["search"]);
}
 
fkelly







PostPosted: Wed Nov 29, 2006 2:47 pm Reply with quote

I think you need single quotes around page and search. I've never tried it with double.
 
hinksta







PostPosted: Wed Nov 29, 2006 3:07 pm Reply with quote

Got it, Changed the quotes and changed

Code:
$self = $_SERVER['PHP_SELF'];

$nav = '';

for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page ";
}
else
{
$nav .= " <a href=\"$self?page=$page&search=$search\">$page</a> ";
}
}

to
Code:
$self = "modules.php?name=$module_name";

$nav = '';

for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page ";
}
else
{
$nav .= " <a href=\"$self&page=$page&search=$search\">$page</a> ";
}
}


Thanks for your help, I may be back later when I start trying to limit the number of page links. Cheers
 
hinksta







PostPosted: Wed Nov 29, 2006 6:02 pm Reply with quote

It' not as fixed as i thought...

The paging has stopped going to - Sorry, that module file was not found
but now all numbered page links go to page 1, not the corresponding page number.
 
hinksta







PostPosted: Wed Nov 29, 2006 7:12 pm Reply with quote

I put this code back and it works, Embarassed

Code:
if(isset($_GET['page'])) 

{
$pageNum = $_GET['page'];
}
if(isset($_GET['search']))
{
$search = $_GET['search'];
}


anyone know much about limiting the number of page links?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©