PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
hinksta
Worker
Worker


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

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

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
Moderator


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

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

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 Back to top

Make sure the form uses POST and not GET
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


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

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

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'];
}
View user's profile Send private message Visit poster's website
fkelly
Moderator


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

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

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.
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


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

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

I changed it to this but makes no difference
Code:
if(isset($_POST["page"])) {
      $pageNum = ($_POST["page"]);
}
if(isset($_POST["search"])) {
      $search = ($_POST["search"]);
}
View user's profile Send private message Visit poster's website
fkelly
Moderator


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

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

I think you need single quotes around page and search. I've never tried it with double.
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


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

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

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
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


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

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

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.
View user's profile Send private message Visit poster's website
hinksta
Worker
Worker


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

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

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?
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum