hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : new question about stripslashes
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

new question about stripslashes

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 12-13-2011, 10:47 AM
Divvy Divvy is offline
Junior Guru Wannabe
 
Join Date: Mar 2010
Posts: 76

new question about stripslashes


Hello friends,

I started this week learning PHP reading some tutorials, so Im very newbie in this...
Can someone tell me how can I display full title inside the title="" ?

I tried change this:
PHP Code:
title=\"" stripslashes$title ) . "\" 
to this:
PHP Code:
title=\"" $title "\" 
but didnt work...
what I am doing wrong?

Here is the complete code:
PHP Code:
if( dle_strlen$row['title'], $config['charset'] ) > 30 $title dle_substr$row['title'], 030$config['charset'] ) . " ...";
        else 
$title $row['title'];

        
$link "<a href=\"" $full_link "\" title=\"" stripslashes$title ) . "\">" stripslashes$title ) . "</a>";
        
$topnews .= "<li>" $link "</li>";
    } 
Thank you

Reply With Quote


Sponsored Links
  #2  
Old 12-13-2011, 11:03 AM
silasistefan silasistefan is offline
Web Hosting Master
 
Join Date: Nov 2011
Location: EU
Posts: 609
the stripslashes function just remove the slashes added by the addslashes function... as i can see from your complete code section, i believe that you're getting that info from a database... did you change something above that section that is preventing the title variable to be populated?

__________________
SpiderVPS
Cheap, but HUGE... (usually UNManaged VPS)

Reply With Quote
  #3  
Old 12-13-2011, 11:05 AM
Divvy Divvy is offline
Junior Guru Wannabe
 
Join Date: Mar 2010
Posts: 76
thank you for your reply silasistefan.

hmmm here is the full code:
PHP Code:
<?php


if( ! defined'DATALIFEENGINE' ) ) {

    die( 
"Hacking attempt!" );

}



$topnews dle_cache"topnews"$config['skin'] );



if( 
$topnews === false ) {

    

    
$this_month date'Y-m-d H:i:s'$_TIME );

    

    
$db->query"SELECT id, title, date, alt_name, category, flag FROM " PREFIX "_post WHERE approve='1' AND date >= '$this_month' - INTERVAL 1 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10" );

    

    while ( 
$row $db->get_row() ) {

        

        
$row['date'] = strtotime$row['date'] );

        
$row['category'] = intval$row['category'] );

        

        if( 
$config['allow_alt_url'] == "yes" ) {

            

            if( 
$row['flag'] and $config['seo_type'] ) {

                

                if( 
$row['category'] and $config['seo_type'] == ) {

                    

                    
$full_link $config['http_home_url'] . get_url$row['category'] ) . "/" $row['id'] . "-" $row['alt_name'] . ".html";

                

                } else {

                    

                    
$full_link $config['http_home_url'] . $row['id'] . "-" $row['alt_name'] . ".html";

                

                }

            

            } else {

                

                
$full_link $config['http_home_url'] . date'Y/m/d/'$row['date'] ) . $row['alt_name'] . ".html";

            }

        

        } else {

            

            
$full_link $config['http_home_url'] . "index.php?newsid=" $row['id'];

        

        }

        

        if( 
dle_strlen$row['title'], $config['charset'] ) > 30 $title dle_substr$row['title'], 030$config['charset'] ) . " ...";

        else 
$title $row['title'];

        

        
$link "<a href=\"" $full_link "\" title=\"" stripslashes$title ) . "\">" stripslashes$title ) . "</a>";

        

        
$topnews .= "<li>" $link "</li>";

    }

    

    
$db->free();



    
create_cache"topnews"$topnews$config['skin'] );

}

?>

Reply With Quote
Sponsored Links
  #4  
Old 12-13-2011, 11:11 AM
silasistefan silasistefan is offline
Web Hosting Master
 
Join Date: Nov 2011
Location: EU
Posts: 609
i would do the following change in order to further debug:

instead of
Quote:
$db->query( "SELECT id, title, date, alt_name, category, flag FROM " . PREFIX . "_post WHERE approve='1' AND date >= '$this_month' - INTERVAL 1 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10" );
i would put this
Quote:
$tmpquery = "SELECT id, title, date, alt_name, category, flag FROM " . PREFIX . "_post WHERE approve='1' AND date >= '$this_month' - INTERVAL 1 MONTH AND date < '$this_month' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10";
echo $tmpquery;
$db->query( $tmpquery );
in the webpage you should get the SQL query that you're executing. Copy & paste that in an MySQL console and see if you have the title in the table... if you don't, you found your issue...

__________________
SpiderVPS
Cheap, but HUGE... (usually UNManaged VPS)

Reply With Quote
  #5  
Old 12-13-2011, 11:17 AM
Divvy Divvy is offline
Junior Guru Wannabe
 
Join Date: Mar 2010
Posts: 76
thank you

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Path disclosure: stripslashes() expects parameter 1 to be string, array given in ... gpl24 Hosting Security and Technology 0 03-02-2011 01:51 AM
IP Addresses Allocation Question - Silly Question But Need to Know eastcoastuk Dedicated Server 1 11-16-2009 06:24 PM
A Question of Space & Price - a big question! active8 Running a Web Hosting Business 7 05-18-2006 05:55 PM
PHP: addslashes and stripslashes mylinear Programming Discussion 6 10-17-2005 05:29 PM
php/ mysql stripslashes mod? [LSG]Ben Programming Discussion 3 02-27-2005 02:56 AM

Related posts from TheWhir.com
Title Type Date Posted
The Value of Your Intellectual Property Blog 2013-05-06 17:43:13
Joomla Hosting Study Shows Speed, Uptime Top Selling Points of a Web Host Web Hosting News 2012-11-07 15:06:36
10-14-2012 Roswell, NM - The Hosting Shift Blog 2012-10-24 15:14:40
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
Blackberry the UnCloud Blog 2011-10-14 15:28:54


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?