Current location: Hot Scripts Forums » Programming Languages » PHP » Need help with jokescript


Need help with jokescript

Reply
  #1 (permalink)  
Old 03-05-07, 03:16 AM
nomirock nomirock is offline
Newbie Coder
 
Join Date: Mar 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Need help with jokescript

i have php joke script. but when i click on my next page to preview more jokes it redirects me to index page
here is the jokes_category.php

PHP Code:

<?
include ("config_file.php");
include(
DIR_LNG.'jokes_category.php');
$display_nr $display_nr_joke_category;
$type TEXT_JOKE_ON;
$jokes_file 1;
$database_table_name1 $bx_db_table_joke_categories;  
$database_table_name2 $bx_db_table_jokes;            

$condition " where ".($HTTP_GET_VARS['cat_id'] ? " category_id='".$HTTP_GET_VARS['cat_id']."' and " "")." validate='1' and slng='".$slng."' ORDER BY rating_value DESC ";
$SQL "select * from $database_table_name2 ".$condition;

if (
$HTTP_GET_VARS['cat_id'])
{
    
$show_joke_categories="yes";
}

include (
DIR_SERVER_ROOT."header.php");

if (!
$HTTP_GET_VARS['cat_id'])
{
    include (
DIR_FORMS."jokes_category_form.php");    
}
else
{
    include (
DIR_FORMS."jokes_category_with_jokes_form.php");
}

include (
DIR_SERVER_ROOT."footer.php");
?>
PLz help me

Last edited by Nico; 03-05-07 at 04:29 AM. Reason: Please use [php] wrappers when posting PHP code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-05-07, 10:13 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The only thing apparent in the code you posted is that $HTTP_GET_VARS can be disabled in php 5, using the register_long_arrays setting.

Change any occurrence of $HTTP_GET_VARS to $_GET
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-05-07, 01:29 PM
Bon Bon Bon Bon is offline
Newbie Coder
 
Join Date: Mar 2007
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Also change
PHP Code:

if (!$HTTP_GET_VARS['cat_id']) 

to
PHP Code:

if (!isset($HTTP_GET_VARS['cat_id'])) 

to avoid any error messages and reduce the chances of the script slowing due to this.

You will need to do this for all of the $_GET variables you have used.

Although this should not affect the redirect issue.

Last edited by Bon Bon; 03-05-07 at 01:31 PM. Reason: Additional commenting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-05-07, 02:58 PM
nomirock nomirock is offline
Newbie Coder
 
Join Date: Mar 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
i tried what you said to do but it did not work
visit my site http://www.sms.mojmasty.com and let me solve the problem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 12:14 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.